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());
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)