给出employees表中排名为奇数行的first_name
给出employees表中排名为奇数行的first_name
https://www.nowcoder.com/practice/e3cf1171f6cc426bac85fd4ffa786594
# 先将数据原来顺序进行排名,以及按照first_name升序进行排名得到 with t1 as ( select first_name, ROW_NUMBER() OVER() as t_rank1, ROW_NUMBER() OVER (ORDER BY first_name) as t_rank2 from employees ) # 想要排名为奇数 select first_name as first from t1 where MOD(t_rank2, 2) != 0 order by t_rank1;