INSERT INTO `tableA`
SELECT `Col1`,
`Col2`,
NOW()
FROM `tableB`
WHERE tableA.Col1 is not already in tableB.Col1
I can't get the WHERE clause right to ensure that the record copied from tableA only appears in table B once...
should read:
where tableA.col1 not in (select col1 from table B)
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