I have 2 tables "Source" and "Destination" that have the same fields, except for the destination having an extra 'date' field
I need to copy the all the fields to their corresponding fields in destination leaving date blank.
I tried:
INSERT INTO Destination SELECT * FROM Source
got :
[SQLITE_ERROR] SQL error or missing database (table destination has 18 columns but 17 values were supplied).
How can I make this work?
The error message is pretty clear - you're trying to insert 17 values into a table with 18 columns and SQL doesn't know what you intend.
You fix that by specifying those columns explicitly, e.g.:
INSERT INTO Destination(field1, field2, ... field17)
SELECT field1, field2, ... field17
FROM Source;
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