这是一个通用分页库产生的代码,根据图片的注释,如果去掉前面的fundTime排序放到后面是正常,这是为什么呢?
1 回答
慕姐4208626
TA贡献1852条经验 获得超7个赞
SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY fundTime desc) as row_number,* FROM( A.userID from yw_user_fundlog A LEFT JOIN yw_user B ON A.userID=B.userID where 1=1 AND (B.name LIKE '%440%' OR B.mobile LIKE'%440%') group by A.userID,convert(varchar(10), fundTime,20))t) tt WHERE tt.row_number between 1 and 10
只要先分组,然后再排序就好了
添加回答
举报
0/150
提交
取消