first three highest salaries
-
hi all can anyone tell me how to (query to)find the first three highest salaries from a table. Example input Name Salary a 1000 b 5000 c 8000 d 11000 e 15000 f 2000 output: salary 15000 11000 8000 thanks in advance...
pintoo
select top 3 salary from tablename order by salary desc
Reasons are not Important but Results are Important
-
select top 3 salary from tablename order by salary desc
Reasons are not Important but Results are Important
-
hi thanks for answering..can u tell me how to write(modify) this query without using TOP keyword.
pintoo
-
hi thanks for answering..can u tell me how to write(modify) this query without using TOP keyword.
pintoo
I think that the Top will be the best choice, unless your using something other than SQL Server. If your using MySQl, use
Limit 3
at the end of the statement.Select Salary
From tablename
Order By Salary Desc
Limit 3I think any other method will cause overhang.