在SQL查询中找到第5行

时间:2015-09-02 06:52:25

标签: mysql sql

我正在使用MySQL / MySQL Workbench,如果我想通过studentName选择第5个返回的行顺序,那么解决方案是什么?感谢。

select * from Students order by studentName;
提前谢谢, 林

1 个答案:

答案 0 :(得分:1)

您可以在以下内容中使用LIMIT

SELECT * 
FROM Table1 
ORDER BY Id 
LIMIT 4,1 -- here you provide which row you want to retrieve
          -- 4 indicates from which row start selecting (offset)
          -- 1 - how many rows you want to retrieve
          -- you can change It as you like