select a from #tab1 x where not exists(select 1 from #tab1 where a = x.a + 1)
解决方案 »
- 急急急急急急急急急急急急急急急急!!!!!!关于计算有效工作时间问题
- 在创建表的时候,字段是否可以允许“-”
- 求SQL
- 急!!!!能不能 从左边开始截取3个后 从第四个开始截取到最前面????
- 新手求救!!!sql查询问题 高分求教
- 急~~~如何用SELECT语句的到最到最后一行的或者的到IDENTITY字段的下一个值
- MSDE2000安装问题---在线等待。。。。。。。。。。。。____。。。。^-^ 。。。
- 有关数据精度问题
- 数据库中的metadata是什么意思?
- 挑战绝对高手:AIX(Unix)下Oracle8i的操作,急!急!!急!!!
- <SQL2000中文版联机丛书>那里有下载?急!
- 为什么我的SQLserver装不上去???帮我看看
where not exists(select 1 from table1 where 字段1 = x.字段1 + 1)
insert @ values(2)
insert @ values(1)
insert @ values(7)
insert @ values(8)select min(a) from @ tem where not exists(select 1 from @ where a-1=tem.a)
returns int
as
begin
Declare @return1 int
Declare @i int
set @i=1
while (@i < 5)
begin
if (cast(substring(@str,@i*2 - 1,1) as int) + 1) <> cast(substring(@str,(@i+1)*2 - 1,1) as int)
begin
set @return1=substring(@str,@i*2 -1,1)
break
end
set @i=@i + 1
end
return @return1
endselect 字段1,dbo.getnotcontinue(字段1) from table1