View Single Post
  #1 (permalink)  
Old 02-21-2008, 01:55 AM
Caspersky12 Caspersky12 is offline
Newbie
 
Join Date: Feb 2008
Posts: 6
Rep Power: 0
Caspersky12 is on a distinguished road
Default SQL insert and update

Is there any1 can help me to my lines
ex...

Table 1
Acct_Num Name
123456 Mhel
123465 Jhen

Table2
Acct_Num Name
123456 Mhel
125555 Jenny
133455 Led

I want to insert the record not listed in the Table 1 e.g(125555, Jenny and 133455, Led) but, the problem is Table 2 has an existing record from Table1...

Insert into Table1(Acct_Num, Name) Select Acct_Num,Name from Table2 where not exists(Select Acct_Num, Name from Table1)

tnx, i highly appreciated those who want to give some help...
Reply With Quote

Sponsored Links