Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How we can update the last N rows in a table using sql
Posted
Comments
thatraja 28-Oct-13 7:10am    
last N rows based on what?

1 solution

You have provided very Little information. Here is my guess
SQL
UPDATE TABLE SET .... WHERE ID IN (select TOP N ID from TABLE order by ID DESC)


you have to change order by clause based on your criteria
 
Share this answer
 
v3
Comments
udayams 28-Oct-13 7:17am    
Thanks for your answer
Amol_B 28-Oct-13 7:18am    
You are welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900