SQL查询表中最后一条数据
文章目录
准备数据表
建立student表,并插入几条数据
查询最后一条数据
本文共分为三种方式
//max(id) 函数 select * from student where id = (select max(id) from student); //order by id desc limit 1 select * from student order by id desc limit 1; //last_insert_id() 函数 select * from student where id = (select last_insert_id());