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...
SQL insert and update
Started by Caspersky12, Feb 20 2008 11:55 PM
1 reply to this topic
#1
Posted 20 February 2008 - 11:55 PM
|
|
|
#2
Guest_Jordan_*
Posted 21 February 2008 - 12:09 PM
Guest_Jordan_*
I don't understand what you are asking. From what I see you are trying to insert 125555 and Jenny but a record already exists? You can use "delete" to remove the record:
And then run your insert command. Not sure what you are trying to do though.
DELETE FROM tb1 WHERE Acct_Num="125555";
And then run your insert command. Not sure what you are trying to do though.


Sign In
Create Account

Back to top









