各位大神求幫幫老年人,求H列和I列的SQL陳述句,或實作方法

uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
select *
, case when H>0 then H else maxValue end as I
from(
select *
, case 取值測驗方式 when 'Type1' then Type1
when 'Type2' then Type2
when 'Type3' then Type3
end as H
, case when Type1>=Type2 and Type1>=Type3 then Type1
when Type2>=Type1 and Type2>=Type3 then Type2
else Type3 end as maxValue
from t
) as tt
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/64816.html
標籤:應用實例
上一篇:如何增加用戶積分,我萌新,求告訴
下一篇:是誰連接資料庫查詢了哪些表?
