我想向我的代碼添加以下邏輯(這是巨大的,沒有這個工作,所以必須是下面的代碼有問題),但我得到一個錯誤。我懷疑,什麼是錯與END但在邏輯思維所有3應該是在年底,所以我不知道多個案例陳述不工作
case
when t0."Final Sale Price" is null
then null
else case
when t1."Fee" is not null
and t0."Final Sale Price" >= t1."Guaranteed Price"
then t1."Fee"
else case
when t1."Fee" is not null
and t0."Final Sale Price" <= t1."Guaranteed Price"
then t1."Fee" - (t1."Guaranteed Price" - t0."Final Sale Price")
else case
when t0."Final Sale Price" < t1."Guaranteed Price"
then t0."Final Sale Price" - t1."Guaranteed Price"
else(
(
(t0."Final Sale Price" - t1."Guaranteed Price") * (100 - t1."Seller Upside %")
)
/100
)
end
end
end as "Actual Revenue"
我算了四個案例,但只有三個結局 – David784
而且我只能找到案例表達式,而不是單個案例語句。 – jarlh