时间:2021-07-01 10:21:17 帮助过:43人阅读
SELECT * FROM (SELECT columns,ROWNUM AS RN FROM (SELECT DISTINCT columns FROM table WHERE 1=1)) T WHERE RN = ‘1‘ SELECT * from (SELECT columns,(ROW_NUMBER() OVER (ORDER BY column DESC)) RN FROM (SELECT DISTINCT columns FROM table) t1) t2 WHERE t2.RN>1 AND t2.RN<5
分组排序SQL
标签: