Click here to Skip to main content
15,907,913 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a table employee having salary column.
SQL
ID Salary
== ======
1  10000
2  10000
3  30000
4  20000
5  25000


now how to select top 3 salaries in a single query.
Posted
Updated 28-May-15 19:15pm
v2

Well its quite basic SQL assuming you are using MS SQL. Try this

SQL
SELECT TOP 3 SALARY
FROM   EMPLOYEE
ORDER BY SALARY DESC
 
Share this answer
 
v2
Comments
Member 8222588 29-May-15 1:16am    
thanks
 
Share this answer
 
Comments
Member 8222588 29-May-15 1:16am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900