这个查询简单吗?征集最佳方案...... 上一条:select max(主键列) from 你的表 where 主键列 < 你刚刚查出的主键值下一条:select min(主键列) from 你的表 where 主键列 > 你刚刚查出的主键值 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 下一条的 select top 1 * from table where 主键>上一条 select top 1 * from table where 主键< order by 主键 desc或者alert table add column id(int ,identity(1,1)) 我想知道SQLserver中有没有隐藏的自增主键。 没有,可以alert table add column id(int ,identity(1,1)) 增加 你可以通过#TEMPTABEL,加入你需要的排序和identity(1,1) 字段,通过该表进行定位!不过用游标是一个比较安全和正统的方法. 下一条的 select top 1 * from table where 主键>上一条 select top 1 * from table where 主键< order by 主键 desc不行吗 to tjan:主要是我的主键是不规则的字符组成,不存在大小问题。 请问分布式结构的数据库系统和c/s结构的的数据库系统有什么区别? 求一条sql语句 数据库一对多多表连接 怎么消除结果中重复的列 SQL语句:更新语句中,在时间上加1天,或加1个小时,要怎么写? 查询最近3天的数据,这个查询语句怎么写呢?!多谢 存贮过程功能生成流水号,输出结果不对,请帮助看一下! MS SQL Server2000中binary类型存储日期的显示 update语句 进销存的思路, 分布数据库的问题 SQLserver2000对 XML 的支持!!!!!!!!!!!
select top 1 * from table where 主键>
上一条
select top 1 * from table where 主键< order by 主键 desc
或者
alert table add column id(int ,identity(1,1))
增加
不过用游标是一个比较安全和正统的方法.
select top 1 * from table where 主键>
上一条
select top 1 * from table where 主键< order by 主键 desc
不行吗