-1
請讓我知道如何通過Excel中提供的公式計算E列。 查找前9行的最小值和最大值
select ROW_NUMBER() OVER (ORDER BY [A] asc) AS id,A,B,C,0 as E into #temp from dbo.rawdata
order by id asc
-------------------------
update #temp
set E=((select max(h.B) from(select top (9) b.B from #temp b where b.id<#temp.id order by b.id asc)h) + (select min(l.C) from(select top (9) c.C from #temp c where c.id<#temp.id order by id asc)l))/2
where id>10
但我需要更新我的t能通過e值 – MahdiIBM
@MahdiIBM請在問題中指定。你能否詳細說明你想更新的內容? – Siyual
store(Max(T2.B)+ Min(T2.C))/ 2 As E to my table – MahdiIBM