query for selecting top 5 salaries from table [duplicate]
Possible Duplicate:
How to select top N from a table
How can a write a query for selecting the top 5 salaries from table开发者_JS百科 ?
SELECT TOP 5 Salary
FROM SalariesTable
ORDER BY Salary DESC
SELECT TOP 5 Salary
FROM Salaries
ORDER BY Salary DESC
To get the TOP 5
highest Salaries:
SELECT DISTINCT TOP 5 MAX(Salary)
FROM Salaries
GROUP
BY Salary
ORDER
BY Salary DESC;
精彩评论