输出first_name排名(按first_name升序排序)为奇数的first_name

对于employees表中,输出first_name排名(按first_name升序排序)为奇数的first_name
CREATE TABLE `employees` (
`emp_no` int(11) NOT NULL,
`birth_date` date NOT NULL,
`first_name` varchar(14) NOT NULL,
`last_name` varchar(16) NOT NULL,
`gender` char(1) NOT NULL,
`hire_date` date NOT NULL,

PRIMARY KEY (`emp_no`));
 
 
select e1.first_name from employees e1
where (select count(*) from employees e2 where e2.first_name<=e1.first_name)%2=1
原文地址:https://www.cnblogs.com/liuxiangyan/p/14378137.html