select * from (
select row_number() over(ORDER BY inspecdate desc,inspectime DESC,itemorder asc ) as num,
contentid,quesioncontext,tempid,tempname,itemid,itemtext,belongteam,teamname,inspecdate,
inspectime,contenttext,createperson,newaddtime,updatetime,operater,itemorder
FROM tb_inspecreports_content
) U
where 1=1 and U.tempid=‘ae1a3e7b-5307-4b97-a8c4-1dbbaf5a9b36‘ ORDER BY
U.inspecdate desc,U.inspectime DESC,U.itemorder asc
sqlserver row_number 类似 mysql中 limit 用法
时间: 2024-10-19 11:55:13