Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to update the records in table1 which is equal to table2 code field how to do it.For example my two table has
Table1
code      Status
WN007      NotPaid
WN008      NotPaid

Table2 
Billno   Code
2001     WN007
2003     WN009  

I want update like following used billno field how to do it
Table1
Code        Status
WN007        Paid
WN008        NotPaid
Posted
Updated 10-Jan-12 20:19pm
v2

1 solution

Here it is :

SQL
Update Table1 
Set Status = 'Paid'
Where code in (select code from table2)
 
Share this answer
 
Comments
devausha 11-Jan-12 2:25am    
Thank you very much

Thanks alot
Amir Mahfoozi 11-Jan-12 4:18am    
You're welcome.
sravani.v 11-Jan-12 2:26am    
My 5!
Amir Mahfoozi 11-Jan-12 4:18am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900