can any one tell me how to write the query to find out first 6 highest salary from table
note: not 6 th highest salary ....

Recommended Answers

All 5 Replies

select top 6 * from table_name order by salary asc

actually it needs to be descending or else you will get bottom to top

select top 6 * from table_name order by salary desc

he only need to find out first 6 highest salary, but no requrement for any sort on these 6 highest salary...

he said the 6 highest salaries, if you do an asc sort, you will get the 6 lowest salaries, not highest

oh! sorry for my misunderstanding:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.