I want to copy table1 to table2 except for the ‘id’ field because i want the ‘id’ in table2 to increment automatically.
Here is one of the solution i have tried… but not working:
“INSERT INTO table2 SELECT field1, field2, field3 FROM table1 WHERE member_id = ’53′”
You can select NULL in place of the id, if you don’t (for whatever reason) want to name the columns.
Assuming both of your tables have the columns
field3, in that order, you can do:
insert into table2 select NULL, field1, field2, field3 from table1 where member_id = '53';
NOTE: you must provide a value for ALL columns, using this format.
Answered By – v4nz