在整个sql外面来一个order by就可以了
(select distinct *
FROM (SELECT *, row_number() OVER (ORDER BY name) AS rnum FROM TempView
where 1=1 ) A WHERE A.rnum BETWEEN 1 and 40) ORDER BY name
在整个sql外面来一个order by就可以了
(select distinct *
FROM (SELECT *, row_number() OVER (ORDER BY name) AS rnum FROM TempView
where 1=1 ) A WHERE A.rnum BETWEEN 1 and 40) ORDER BY name