0
copying between multiple tables
New Here
,
/t5/coldfusion-discussions/copying-between-multiple-tables/td-p/3595194
Aug 03, 2011
Aug 03, 2011
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
TOPICS
Database access
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Advocate
,
LATEST
/t5/coldfusion-discussions/copying-between-multiple-tables/m-p/3595195#M136662
Aug 04, 2011
Aug 04, 2011
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
)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

