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.
我想知道如何从mysql中的表中获取第n个最大值请给我一个简单的查询
SELECT expectedValue FROM fooTable ORDER BY expectedValue LIMIT n-1,1
其中 n 是您的nth价值(n-1零索引)
nth
n-1
查看此 sql fiddle 以检索第 5 个更高的值:示例
SELECT DISTINCT(your_value) FROM table ORDER BY your_column DESC LIMIT n-1,1
我是 Rails、jquery 等的新手。我创建了一个新项目,一切正常。现在我想每隔几秒刷新一个 HTML 表。
我在视图中的表格如下所示:
<table> <% @new.each do |s| %> <tr> <td><%= s.name %></td> <