By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,362 Members | 1,344 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,362 IT Pros & Developers. It's quick & easy.

Delete Query

P: 2
delete tst where a.meetingno and lfcode in ( select lfcode,a.meetingno from tst a
inner join (select centercode, max(meetingno) as meetingno
from grmts
where closedate is null and updateflag<>'D'
group by centercode) b
on a.centercode=b.centercode and a.meetingno>=b.meetingno)

Subquery return multi values i want to delete in single query it is possible
Apr 8 '08 #1
Share this Question
Share on Google+
2 Replies


100+
P: 142
Try this:

delete tst where a.meetingno and lfcode in ( select Top 1 lfcode,a.meetingno from tst a
inner join (select centercode, max(meetingno) as meetingno
from grmts
where closedate is null and updateflag<>'D'
group by centercode) b
on a.centercode=b.centercode and a.meetingno>=b.meetingno)


Regards,
Balaji U
Apr 8 '08 #2

100+
P: 142
Try this:

delete tst where a.meetingno and lfcode in ( select Top 1 lfcode from tst a
inner join (select centercode, max(meetingno) as meetingno
from grmts
where closedate is null and updateflag<>'D'
group by centercode) b
on a.centercode=b.centercode and a.meetingno>=b.meetingno)


Regards,
Balaji U
Apr 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.