In MySQL you can use ORDER BY to sort the rows in descending order and use LIMIT to return only the top 5 rows:
SELECT id, usrname, salary
FROM yourtable
ORDER BY salary DESC
LIMIT 5
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7097 次 |
| 最近记录: |