Copy link to clipboard
Copied
I have some records in tables A with fields i.e firstname surname, lastname, school, dob
I have another table B with some records and fields i.e firstname, surname, address, club,
There are some records in table B which exists in table A
I'd like to use the firstname and surname in table B to check if the record exist in table A.
if it doesnt it should append the record to table A.
I would be glad if you can help me with this
Copy link to clipboard
Copied
INSERT INTO TableA (firstname, lastname .......)
SELECT
firstname
, lastname
, ...
FROM
TableB
WHERE NOT EXISTS (
SELECT *
FROM TableA
WHERE
TableA.firstane = TableB.firstName
AND TableB.lastName = TableA.lastName
)