Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含一列值的表记录,其中有 10 条记录,例如,
10,2,5,6,9,4,1,7,8,3。我想获得两个最大值或最大值,例如。9和10,查询会是什么?
这会做到的
SELECT value FROM records ORDER BY value DESC LIMIT 2
输出:
| 价值 | |-------| | 10 | | 9 |
这是SQLFiddle演示
Select * from records order by value desc limit 2