gpt4 book ai didi

mysql - 查询在Mysql中查找第N个最大值

转载 作者:行者123 更新时间:2023-11-29 02:07:49 35 4
gpt4 key购买 nike

如何在 MySQL 中编写查询来查找第 N 个最大值?

最佳答案

SELECT column FROM table ORDER BY column DESC LIMIT (n-1), 1

看看http://php.about.com/od/mysqlcommands/g/Limit_sql.htm阅读 LIMIT on SQL:

Definition: Limit is used to limit your MySQL query results to those that fall within a specified range. You can use it to show the first X number of results, or to show a range from X - Y results. It is phrased as Limit X, Y and included at the end of your query. X is the starting point (remember the first record is 0) and Y is the duration (how many records to display).

关于mysql - 查询在Mysql中查找第N个最大值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2895493/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com