日期:2014-05-18  浏览次数:20662 次

这条Select查询语句应该怎么写?
查询当前id的上两条以及下3条的id



------解决方案--------------------
select top 2 id from table where id>@id order by id asc
union all select top 3 id from table where id>@id order by id desc
------解决方案--------------------
id 号有没有可能不是连续的,如果不是就需要在存储过程加一些逻辑了