如何在sql server中找到薪水 [英] how to find the salary in sql server
本文介绍了如何在sql server中找到薪水的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请一些人告诉我们
如何从emp表中找到第六高薪
请一些人告诉.....
Pls some one tell that
how to find 6th highest salary from emp table
Pls some one tell.....
推荐答案
你好Chander Rani
您可以根据需要使用以下SQL Select Command: -
选择前1 *来自(选择前6名empid,empname,员工薪水来自工资单desc)作为t1工资单;
表名:员工
薪资栏目:薪水
其他栏目:empid,empname
请阅读我最近在代码项目中的文章并给出你的评论和评级。
PHP中的应用程序
问候,
Sunil
Hello Chander Rani
You can use the following SQL Select Command for your requirement:-
select top 1 * from (select top 6 empid,empname,salary from employees order by salary desc) as t1 order by salary;
Table Name: employees
Salary Column: salary
Other Columns: empid, empname
Please read my recent article in code project and give your comments and rating.
Chat Application in PHP
with regards,
Sunil
WITH cte (row,lastname,firstname,salary)
AS(
SELECT TOP 6 ROW_NUMBER() OVER (ORDER BY salary DESC), lastname, firstname,salary FROM salarytable ORDER BY salary DESC
)
SELECT * FROM cte WHERE row=6;
>
这篇关于如何在sql server中找到薪水的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文