求一个sql,大家帮忙! select top 1 * from table where id > 300 order by ascunionselect top 1 * from table where id < 300 order by desc 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select top 3 with ties * from t order by abs(id-300) alter table A add ID1 int idendity primary keyselect * from A where ID1=(select ID1 from A where id=300)-1 or ID1=(select ID1 from A where id=300)+1 select * from table where id in (select min(id) from table where id>300 union select max(id) from table where id<300) select top 2 with ties * from t where abs(id-300)>0 order by abs(id-300) 请问怎样在已建立表中进行增加主键? 求一简单SQL语句 在线等。很简单的SQL语句报错。谢谢! 问一linq调用存储过程 sql语句拼接问题 一个商品分类问题请教! 求产品信息信息排序SQL语句~~~~~~~~~~~~~~~~~~~~~ 复杂SQL查询问题 80万条记录,select top 100 * 需要4分钟,不知道是什么问题 关于表的设计 sa N’是啥意思?? 刚学server,真的很多问题不会,连数据库都连不上,大家帮帮忙!
select * from A where ID1=(select ID1 from A where id=300)-1
or ID1=(select ID1 from A where id=300)+1
(select min(id) from table where id>300
union
select max(id) from table where id<300)