MYSQL :(
| From: | John Taylor-Johnston | Date: | Fri, 07 Mar 2003 06:18:25 +0000 |
| Subject: | MYSQL :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138572@lists.php.net to get a copy of this message | ||
Ok, I'm off topic. I'm trying to build some php code but can't get my SQL right.
http://www.mysql.com/doc/en/INSERT_SELECT.html
insert into ccl.ccl_maintest
(id,RNum,YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,SR,PL,PR,JR,VNum,INum,DT,PG,LG,SF,OL,KW,AUS,GEO,AN,RB,CO,RR)
select
id,RNum,YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,SR,PL,PR,JR,VNum,INum,DT,PG,LG,SF,OL,KW,AUS,GEO,AN,RB,CO,RR
FROM jdaxell.ccl WHERE id = 23
I have tried "WHERE jdaxell.ccl.id = 23" but it does the same thing.
It copies jdaxell.ccl.id=23 and inserts at ccl_maintest.id=23, instead of using the next
auto_increment of ccl.ccl_maintest.id.
How can I get this to use the next auto_increment of id (Next Autoindex = 52)?
Thanks,
John