数据库表:fp_studentItem
- 方法一:不推荐
SELECT * FROM fp_studentItem where id=( SELECT MAX(id) FROM fp_studentItem where studentid=1)
- 方法二:推荐
SELECT * FROM fp_studentItem WHERE studentid=1 ORDER BY id DESC LIMIT 1
数据库表:fp_studentItem
SELECT * FROM fp_studentItem where id=( SELECT MAX(id) FROM fp_studentItem where studentid=1)
SELECT * FROM fp_studentItem WHERE studentid=1 ORDER BY id DESC LIMIT 1