标签: mysql sql
例如
1 10 8 9 5
我应该在给定列中找到最多两个值,因为在sql查询中答案是10和9
答案 0 :(得分:8)
您可以使用order by和limit:
order by
limit
select col from t order by col desc limit 2;
如果列可能有重复项,则使用select distinct col。
select distinct col