如何在MySQL的员工表中找到第七高工资的行?我试过这种方法,但无法得到准确的查询。
SELECT MAX(salary) FROM employee WHERE salary NOT IN (SELECT MAX(salary) FROM employee)
06odsfpq1#
多么简短的帖子!!!试试这个,
select * from( select distinct salary from employee order by salary desc limit 7 ) t order by salary limit 1
wj8zmpe12#
也许你可以用这个
SELECT * FROM employe ORDER BY salary DESC LIMIT 7
我希望这对你有帮助
r6l8ljro3#
我知道答案了。
SELECT * FROM one one1 WHERE ( 7 ) = ( SELECT COUNT( one2.salary ) FROM one one2 WHERE one2.salary >= one1.salary )
r7knjye24#
SELECT * FROM employees emp WHERE 7 = (SELECT COUNT(DISTINCT salary) FROM employees WHERE emp.salary<=salary );
4条答案
按热度按时间06odsfpq1#
多么简短的帖子!!!试试这个,
wj8zmpe12#
也许你可以用这个
我希望这对你有帮助
r6l8ljro3#
我知道答案了。
r7knjye24#