------解决方案-------------------- select top 1 * from tb order by id select top 1 * from tb order by id desc
------解决方案--------------------
SQL code
SELECT * FROM
(select top 1 * from tb order by id )x
UNION ALL
SELECT * FROM
(select top 1 * from tb order by id desc)x
------解决方案-------------------- top 和排序就可以了
------解决方案-------------------- 哦
------解决方案--------------------
------解决方案-------------------- select top 1 * from tb order by id select top 1 * from tb order by id desc