Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 delete top

Author  Topic 

Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-04-03 : 11:55:00
what's wrong with this statement and how would I do it:

delete top 193 from users where pdupeid=311 order by myid desc

SQL Natt Alfen

3279 Posts

Posted - 2005-04-03 : 12:02:03
You can't use TOP and ORDER BY with DELETE.
DELETE users WHERE myid IN(
SELECT TOP 193 FROM users WHERE pdupeid = 311 ORDER BY myid DESC)

Go to Top of Page

- Advertisement -