row_number() over (partition by nf order by cs desc)<= 50
时间: 2023-10-27 09:52:25 浏览: 87
row_number,根据多个字段过滤,partition by
This SQL code is using the window function `row_number()` to assign a unique ranking number to each row within a partition of the result set. The partition is defined by the value of the column "nf", and the rows within each partition are ordered by the value of the column "cs" in descending order.
The code is then using a filter condition to limit the result set to only those rows where the ranking number is less than or equal to 50. In other words, it is selecting the top 50 rows within each partition based on the value of "cs".
Overall, this code is useful for ranking and selecting the top results within each group of data based on a specific column value.
阅读全文