1
表看起來是這樣的:根據SQL Server 2008中的序列/等級進行更新?
create table #rankme (rankmeid int identity(1000, 1) primary key,
step int null, checkvalue int null)
insert into #rankme values (10 , 1)
insert into #rankme values (15 , null)
insert into #rankme values (20 , null)
insert into #rankme values (40 , null)
select * from #rankme order by step,checkvalue
以step
作爲參數,我試圖找出是否要求checkvalue
爲step
前一次我問是空的。
所以我想選擇where step=20
並得到NULL
。我想選擇where step=15
並獲得1
。
我試圖想出一些基於「等級1」但迄今沒有雪茄的東西。
幫助?