Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a table name employee..
C#
id     name     salary
1       a	10000
2	b	5000
3	c	8000
4	d	15000
5	e	18000

I wanna a output of highest 3 transactions as below:
C#
id  name  salary
5    e    18000
4    d    15000
1    a    10000

Please reply.
Posted
Updated 3-Sep-13 23:36pm
v2

Try:
SQL
SELECT TOP 3 * FROM employee ORDER BY salary
 
Share this answer
 
Comments
[no name] 4-Sep-13 5:14am    
My vote +5
SQL
Select Top 3 *From employee order by salary DESC.
 
Share this answer
 
v2
SQL
SELECT TOP 3 *
FROM  (SELECT *
       FROM   table_Name
       ORDER BY Salary)
 
Share this answer
 
v3

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