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.
有没有办法通过插入时间戳对选择查询中的行进行排序,而没有时间戳列。所以我想找到最近插入的行,但是没有记录插入时间戳的列。这里有每一行的内部记录吗?
表没有主键,外键。
No,如果你有主键自动增量,你可以找出结果。但是有可能在不同的日/月/年插入了两个连续的行。所以,only depending on the primary you can't find out the recent records.
No
only depending on the primary you can't find out the recent records.
如果您有一个主键字段(并且该主键不必是自动增量),那么可以像这样实现
SELECT * FROM table ORDER BY _rowid DESC