最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

如何从表中找到第二高的薪水。

SEO心得admin33浏览0评论
本文介绍了如何从表中找到第二高的薪水。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

亲爱的 i希望从table.table中找到第二高的薪水,在emp表中包含一些重复值。 表格如.. eid名称薪水depatmentid 100 vijay 66000 10 101 sumit 22000 20 102 sohan 25000 30 103 Bhagat 25000 30 104 sunil 22000 40 105 sumit 24000 40 106 sunil 22000 10 107 kumar 26000 50 108史密斯120033 50 110 arun 12033 10 111 gyanesh 122233 50 112 sunita 10033 40 113 kanchan 120033 50 请帮忙解决这个问题......

dear i want to find second highest salary from table.table contain some duplicate values in emp table. table like.. eid name salary depatmentid 100 vijay 66000 10 101 sumit 22000 20 102 sohan 25000 30 103 Bhagat 25000 30 104 sunil 22000 40 105 sumit 24000 40 106 sunil 22000 10 107 kumar 26000 50 108 smith 120033 50 110 arun 12033 10 111 gyanesh 122233 50 112 sunita 10033 40 113 kanchan 120033 50 pls help to resolve this problem...

推荐答案

快速搜索Q& A这里会发现你先前已经问过21个问题。 Q& A搜索结果 [ ^ ] 如果您真的需要社区的帮助,请对您的主题进行简单的Q& A搜索,看看是否问题已被提出。 A quick search on the Q&A here would have found you 21 previous questions already asked here. Q&A search results[^] If you really want help from the community, please perform a simple Q&A search on your topic ans see if the question had already been asked.

下面的查询会给你更正确的答案: - below query will give you more correct answer:- select * from ( select dense_rank() over (order by sal desc) as num, * from tablename) a where num=2

SELECT MAX( Salary) FROM Emp WHERE Salary < ( SELECT MAX(Salary) FROM Emp )

发布评论

评论列表(0)

  1. 暂无评论