我在获取与研究映射的不同优先级时遇到问题,
这里是我为获取结果而编写的查询,但结果是以升序获取记录,但内部查询以相反的顺序获取它
如果我删除 distinct 我将按降序获取记录 任何人都可以帮助我了解正在发生的事情并纠正它
WITH Results AS
(SELECT priority_fk,
ROW_NUMBER() OVER (ORDER BY priority_fk DESC) AS RowNum
FROM "priorities" P,
"study" S
)
SELECT
distinct priority_fk,
"RowNum"
FROM Results
WHERE RowNum > 0
AND RowNum <= 0 + 100