I have a statement which is complicated like this:
select x.ColA as ColA
, case when x.optA = 'AB' or x.optA = 'FG' or x.optA = 'LM' or x.optA = 'QR' then X.ColB / 100 else X.ColB / 900 End as ColB
, case when x.optA = 'AB' or x.optA = 'FG' or x.optA = 'LM' or x.optA = 'QR' then X.ColC / 100 else X.ColC / 900 End as ColC
, case when x.optA = 'AB' or x.optA = 'FG' or x.optA = 'LM' or x.optA = 'QR' then X.ColD / 100 else X.ColD / 900 End as ColD
, case when x.optA = 'AB' or x.optA = 'FG' or x.optA = 'LM' or x.optA = 'QR' then X.ColE / 100 else X.ColE / 900 End as ColE
From TableA
I want to simplify this into something like this, is it possible:
select x.ColA as ColA
case when x.optA = 'AB' or x.optA = 'FG' or x.optA = 'LM' or x.optA = 'QR' then
, X.ColB / 100 as ColB
, X.ColC / 100 as ColC
, X.ColD / 100 as ColD
, X.ColE / 100 as ColE
Else
, X.ColB / 900 as ColB
, X.ColC / 900 as ColC
, X.ColD / 900 as ColD
, X.ColE / 900 as ColE
End
From TableA