Please explain in detail with query.
How To Delete First Or Last 1000 Rows In SQL-SERVER ?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Please explain in detail with query.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Aug 5, 2022, 1:08 PM EDT
Aryan KumarRank #2,431 · 580 reputationPosted Aug 5, 2022, 1:28 PM EDT
Thanks you so much Sachin. but please update your answer...like below.....
delete from [dbo].[Products] where
ID in (
select ID from (
select Id,Row_number() over (order by ID) RN from [Products]
)
[Products] where RN <=1000
)
Highlighted part (Table Name) is missing in both query. I will accept it once updated ,Thanks
Sachin SinghRank #66 · 26.2K reputationPosted Aug 5, 2022, 1:35 PM EDT