开发者

How can select last 7 max salaries from this table? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.
NAME                        AGE     DEPTNO     SALARY
-------------------- ---------- ---------- ----------
shasank                      25         11       2025
raju                         27         12       2027
bali                         31         10       2031
rambo  开发者_StackOverflow                      32         11       2121
chir                         34         10       2123
son                          33         12       2131
don                          33         11       2132
ram                          28         13       2141
nag                          35         10       2213
dimpu                        33         12       2314


SELECT * FROM yourTable ORDER BY SALARY DESC LIMIT 7


select top(7) *
from table
order by salary desc


MS SQL:

SELECT TOP 7 salary FROM table1 GROUP BY salary

MySQL:

SELECT salary FROM table1 GROUP BY salary LIMIT 0,7
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜