table S (input) has columns A, B
table K (keep) renames them C, D and adds E
Need to add new records if not already there, leaving E null in that case.
Seems like there should be a simpler way than
SQL cookbook tells about Oracle's MERGE but offers no workaround for the others
--
Wes Groleau
table K (keep) renames them C, D and adds E
Need to add new records if not already there, leaving E null in that case.
Seems like there should be a simpler way than
Code:
INSERT INTO K (C, D)
SELECT A, B
FROM S
WHERE NOT EXISTS (A, B)
IN (SELECT C, D FROM K)
--
Wes Groleau