ASP.NET SQL语句问题
如果有一个ID=5我想写一条SQL语句,取出ID=5的,前10条数据和后10条数据,包括ID=5,
共21条怎么处理?? --------------------编程问答-------------------- 有一点没说清楚 ID=5 的前10和后10条数据都是按什么顺序排列的? --------------------编程问答--------------------
--------------------编程问答--------------------
(select top 10 * from (select top 10 * from dbo.TBL_USER order by ID asc)aa )
union all
(select top 10 * from TBL_USER where ID ='5')
union all
select * from
(select top 10 * from dbo.TBL_USER order ID desc)bb
select top 11 * from table where id>5 order by id asc--------------------编程问答--------------------
union all
select top 10 * from table where id <5 order by id desc
select * from [Table] where id>=cint(id)-10 and id<=cint(id)+10
补充:.NET技术 , ASP.NET