Reterving of top 5th value from the table

  • Thread starter Thread starter damodarnarayana
  • Start date Start date
D

damodarnarayana

Table - employee_1

E_ID E_Name Salary
1 Pavan Kumar 5000
2 Ashok 2000
3 Gangadhar 4000
4 Riyaz 2000
5 Kalyan 1000
6 Param 6000
7 Ganesh 7000
8 Pavan Kumar Reddy 8000
9 Vijay 9000
10 Praveen 10000


I had written below query for retrieving the top 4 and 5th values from
a table, but i am not able to retrieve the result,

SELECT TOP 5 employee_1.salary
FROM employee_1
ORDER BY employee_1.salary DESC;

Please help me in this query


Thanks & Regards,
Damodar.M
 
The query looks good to return to the TOP five salaries. What do you get
returned and what do you want returned?

Do you want all the fields returned for E_ID 10, 9, 8, 7, and 6?

Do you want just 6 and 7 returned (4th and 5th highest)?

First is easy, just add in the other fields to your query.

Second is almost as easy, use the existing query as the source for another
query returning the Top 2 Ascending.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top