题解 给出表中排名为奇数行的first_name
给出employees表中排名为奇数行的first_name
https://www.nowcoder.com/practice/e3cf1171f6cc426bac85fd4ffa786594
-- 纳闷了半天顺序,题目说原序列顺序输出 -- 其实就是按照emp_no排序 -- 经典的排序窗口函数放在子查询中 SELECT first_name first FROM ( SELECT emp_no, first_name, ROW_NUMBER()OVER(ORDER BY first_name) rk FROM employees ) t WHERE rk % 2 = 1 ORDER BY emp_no