Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
DLProgrammerLisa
Starting Member
1 Post |
Posted - 2014-11-07 : 03:29:05
|
HiI am comparing names of people from a table without id field to a table that has those people along with their ids.I have a select statements using different field combinations that fetches ids of these people and presents the result set like:table1id,table1firstname,table2firstname,table1lastname,table2lastnamefor eg:1 john john smith smith1 john j smith smith1 john jon smith smitI want to be able to insert all the records from the result set into another table, like in the eg, but only excluding those ones that match all the above fields. How would I do this...Thank you |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-11-07 : 08:45:42
|
insert into anothertable aselect from originaltable owhere not exists ( select ...your current selectlist ... from originaltable o1 where o.id = o1.id) |
|
|
|
|
|