Anonymous 发表于 2022-2-24 11:59:01

如何取得数据库中ID最大的那一条数据

如何取得数据库中ID最大的那一条数据select * from title order by id desc limit 1;根据id降序,取第一条。
select * from title where id = (select max(id) from title);用子查询先取的最大id


页: [1]
查看完整版本: 如何取得数据库中ID最大的那一条数据