简体   繁体   中英

How to select the 3rd row from a table in mysql?

I want to select the 3rd row from the mysql table.

Note: the table is updated frequently. How to select always the 3rd row from column one.

在此输入图像描述

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

The offset of LIMIT clause is Zero based. Try this:

   SELECT *
   FROM emps
   ORDER BY empid
   LIMIT 2, 1

SQL FIDDLE DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM