Click here to Skip to main content
15,946,525 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SELECT top 5 tblIncidentManagement.IncidentName,tblIncidentManagement.IncidentCode, tblIncidentManagement.IncidentId
FROM tblAdminMaster INNER JOIN tblIncidentManagement ON tblAdminMaster.AdminId = tblIncidentManagement.AdminId
WHERE (tblAdminMaster.AdminId = @CreatedFromId) and tblIncidentManagement.IsDelete=0
i want use order by id desc in above query so i can get 5 recent records
Posted

So whats wrong , just add ORDER BY tblIncidentManagement.IncidentId DESC at the end and you will get top 5 records.
 
Share this answer
 
v2
I suggest you read one of the many basic SQL tutorials on the web, or perhaps even buy a book.
 
Share this answer
 

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