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 |
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-02-13 : 06:06:11
|
| hi,I have the following nested query:delete from tableA where tableA.id=1 and name in (select name from tableB where tableb.id in (select tablec.id from tableC where value ='XYZ'))but I donot want a nested query can anyone suggest a way to write this query with joins ?any help appreciated.Regards,Harshal.Expect the UnExpected |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-02-13 : 09:09:45
|
| delete tableA from tableAjoin tableBon tableA.name = tableB.namejoin tableCon tableB.id = tableC.idand tableC.value = 'XYZ'where tableA.id = 1You could also put the tableC.value = 'XYZ' in the where clause if you wish.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-02-14 : 00:07:05
|
quote: delete tableA from tableAjoin tableBon tableA.name = tableB.namejoin tableCon tableB.id = tableC.idand tableC.value = 'XYZ'where tableA.id = 1You could also put the tableC.value = 'XYZ' in the where clause if you wish.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.
Thanks nr.Expect the UnExpected |
 |
|
|
|
|
|