PDA

View Full Version : Add selected records from one table to another using SQL



mud2
04-03-2006, 07:37 PM
OK, I give up...after beating my head against the wall all afternoon.
Two tables...tableR and tableL. Both have same structure, same named fields, one field called field1. I want to add to tableL ONLY those records in TableR where tableR.field1 are NOT equal tableL.field1 Looks like a "Left Join"?? INSERT INTO...WHAT???

geekgirlau
04-03-2006, 11:44 PM
INSERT INTO Table2
SELECT *
FROM Table1 LEFT JOIN Table2 ON Table1.Field1 = Table2.Field1
WHERE Table2.Field1 Is Null