题解 | #给出employees表中排名为奇数行的first_name#
给出employees表中排名为奇数行的first_name
http://www.nowcoder.com/practice/e3cf1171f6cc426bac85fd4ffa786594
/* 先找到 排序后 行数是奇数的 first_name ,再将其作为查询条件 查询*/
select
first_namefrom
employees
where
first_name in
(
select
first_name
from
(
select
first_name,ROW_NUMBER() OVER (order by first_name) as row_num
from
employees
) a
where
a.row_num&1 = 1
)