The following code is giving me a vague and unhelpful error:
INSERT INTO database VALUES * FROM dbtemp WHERE dbtemp.number NOT IN (SELECT dbtemp.number FROM dbtemp INNER JOIN database ON dbtemp.number = database.number AND dbtemp.price = database.price);
I’ve successfully run other queries on these databases, so I know its just a problem with the syntax of this statement. But for the life of me I can’t see what’s wrong. Any suggestions/advice would be greatly appreciated.
Thanks!
Should this have been an
INSERT INTO SELECTstatement? Your syntax ofINSERT INTO database VALUES *is suspect…When doing an
INSERT SELECTlike this, it is advisable to use explicit column names, rather thanSELECT *, to be sure they are returned in the correct order: