Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting top n

Status
Not open for further replies.

wawanz

Programmer
Aug 29, 2002
62
ID
Hi, if I wanted to select the top 100 records I do it with this query: "SELECT TOP 100 * FROM
"...
My question is: what if I want to delete the top 100 records, can I do that? What's the query?

Thanks

 
If you have a unique id, then you can use a sub-query:

delete from

where id in (SELECT TOP 100 id FROM
)

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top