Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

copying between multiple tables

New Here ,
Aug 03, 2011 Aug 03, 2011

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
536
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 04, 2011 Aug 04, 2011
LATEST

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

)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources