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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 delete top
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

esthera
Flowing Fount of Yak Knowledge

1410 Posts

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

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

rockmoose
SQL Natt Alfen

Sweden
3279 Posts

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

rockmoose
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000