Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个包含以下列的表格,
Marks 60 80 70 90 95 90 70
我需要选择前4个带有标记的所有行,即。在这种情况下,>=70 并且应该返回 6 行。
我不知道该怎么做,有人可以帮忙吗?谢谢。
SELECT Marks FROM ( SELECT Marks, DENSE_RANK() OVER (ORDER BY Marks DESC) AS MarksRank FROM yourtable ) WHERE MarksRank <= 4