How to copy data from one table to another & ldquo; EXCEPT & rdquo; a field

advertisements

How to INSERT into another table except specific field

e.g

TABLE A

ID(auto_inc)    CODE    NAME
1               001     TEST1
2               002     TEST2

I want to insert CODE and NAME to another table, in this case TABLE B but except ID because it is auto increment

Note: I don't want to use "INSERT INTO TABLE B SELECT CODE, NAME FROM TABLE A", because I have an existing table with around 50 fields and I don't want to write it one by one

Thanks for any suggests and replies


This can't be done without specifying the columns (excludes the primary key).

This question might help you. Copy data into another table