问题描述
选择前5个tblIncidentManagement.IncidentName,tblIncidentManagement.IncidentCode,tblIncidentManagement.IncidentId
从tblAdminMaster内联接tblIncidentManagement ON tblAdminMaster.AdminId = tblIncidentManagement.AdminId
在哪里(tblAdminMaster.AdminId = @CreatedFromId)和tblIncidentManagement.IsDelete = 0
我想在上面的查询中使用ID desc的顺序,以便获得5条最近的记录.
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
推荐答案
这篇关于sqlserver查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!