Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table to table input 2

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
tblOne has records of addresses. tblTwo has them also. tblOne has some records that tableTwo doesn't have.

How could I say append to tblTwo any records from tblOne that tblTwo doesn't have, please?
 
As long as your tables have a unique identifier then you can use the following

insert into table2(id, col1, col2...)
select id, col1, col2...
from table1 t1
where not exists (select id from table2 t2 where t1.id = t2.id)

HTH

Steve
 
Hi Steve(donvittorio) and Tony Groves

Brilliant. Thanks you so very much.

All the best
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top