方法一: 使用TOP
SELECT TOP 1 * FROM user;
SELECT TOP 1 * FROM user order by id desc;
方法二: 使用LIMIT
SELECT * FROM user LIMIT 1;
SELECT * FROM user ORDER BY id ASC LIMIT 1;
SELECT * FROM user ORDER BY id DESC LIMIT 1;
---------------------
原文:https://blog.csdn.net/diyu122222/article/details/73250982
原文地址:https://www.cnblogs.com/kenshinobiy/p/10792552.html
时间: 2024-10-22 13:28:36