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 |
|
Sonu619
Posting Yak Master
202 Posts |
Posted - 2011-03-15 : 21:10:58
|
| Hi guys, I have two tables, TABLE1ID,FNAME,LNAMETABLE2ID,ADDRESS,PHONEQuestion:- I want to delete ID in Table2 that not in Table1. Thanks in advance. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-03-15 : 21:13:34
|
[code]DELETE t2FROM TABLE2 t2WHERE NOT EXISTS ( SELECT * FROM TABLE1 t1 WHERE t1.ID = t2.ID )[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Sonu619
Posting Yak Master
202 Posts |
Posted - 2011-03-16 : 20:29:07
|
| khtan i appreciate your help.! |
 |
|
|
|
|
|