我如何實現多案例條件?下面說無效語法多個案例條件
SUM(CASE WHEN b.SnapshotDtm = getdate() THEN
CASE WHEN (GenderCd = 'F' And EthnicGroupCd = 'N/A') THEN
(TechAnnualizedExitsPct_M - TechAnnualizedExitsPct_F) *
(TechRepresentCnt_F)/ (365/FiscalYearDayNbr)
else CASE WHEN (EthnicGroupCd in(2,3,5)) THEN
(TechAnnualizedExitsPct_White - TechAnnualizedExitsPct_235) *
(TechRepresentCnt_F)/ (365/FiscalYearDayNbr)
ELSE
CASE WHEN (GenderCd = 'F' And EthnicGroupCd = 'N/A') THEN
(TechAnnualizedExitsPct_M - TechAnnualizedExitsPct_F) *
(TechRepresentCnt_F)/ (365/SnapshotDaysOfYearNbr)
ELSE CASE WHEN (EthnicGroupCd in(2,3,5)) THEN
(TechAnnualizedExitsPct_White -
TechAnnualizedExitsPct_235) *
(TechRepresentCnt_F)/ (365/SnapshotDaysOfYearNbr)
end) as TechExitsDeltaCnt,
的就是你得到確切的錯誤:'近無效的語法..'? –
附近的')'作爲TechExitsDeltaCnt – VeecoTech
您正在使用哪種RDBMS? – CodeNewbie