Query
I want to find top 2 members which get maximum salary then what query i have to used
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hiren SoniRank #694 · 3.5K reputationPosted Dec 23, 2009, 9:27 PM EST
if you are using oracle, then its not works. If you use oracle then let me knw
Lalit MRank #1,186 · 1.5K reputationPosted Dec 23, 2009, 9:23 PM EST
select Distinct Top 2 Salary from EMP order by Salary desc OR select e1.sal from emp e1 where 2=(select count(distnct (e2.sal) from emp e2 where e2.sal>=e1.sal)Hiren SoniRank #694 · 3.5K reputationPosted Dec 23, 2009, 9:27 PM EST
if you are using oracle, then its not works. If you use oracle then let me knw
Lalit MRank #1,186 · 1.5K reputationPosted Dec 23, 2009, 10:08 PM EST
can you tell me where & why i'm wrong???
Lalit MRank #1,186 · 1.5K reputationPosted Dec 27, 2009, 8:34 PM EST