SQL查询表的第一条数据和最后一条数据
时间:2021-07-01 10:21:17
帮助过:28人阅读
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://www.cnblogs.com/weimingxin/p/7929584.html
SQL查询表的第一条数据和最后一条数据
标签:highlight esc div tps select log href tar top