table A's structure is a subset of table B, that means the table A's all the columns are the first columns of table B, but table B has more columns than table A. My question, what's the SQL statment to copy all the rows from table A to table B(the missing columns in table B will be kept empty).
+7
A:
Use:
INSERT INTO TABLE_B
SELECT col1,
col2,
col3,
NULL
FROM TABLE_A
Use NULL as the placeholder for however many columns you can't populate from TABLE_A, assuming TABLE_B columns allow NULL values.
OMG Ponies
2010-10-02 05:06:43