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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With