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.
假设我有这张表,其中我删除了 rowid=3 的行:
rowid | something ------+----------- 1 | ... 2 | ... 4 | ... 5 | ...
如何选择第三行(rowid=4 的那一行)?
select * from table limit 2,1
意思是“从索引 2 开始并返回 1 行”。
select * from yourtable order by rowid limit 1 offset 2;
将为您提供该排序结果集中的第三行(偏移量从 0 开始)。
select Max(row_id) from ( select * from table_name limit 3)