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 表中选择第三行。
注意:该表经常更新。如何始终从第一列中选择第三行。
SELECT * FROM ( SELECT * FROM emps ORDER BY empid LIMIT 3 ) AS T ORDER BY empid DESC LIMIT 1
试试这个::
Select * from tableA order by empid desc limit 3,1
LIMIT 子句的偏移量是从零开始的。试试这个:
SELECT * FROM emps ORDER BY empid LIMIT 2, 1
SQL 小提琴演示