SELECT
DJLXBM,
CASE WHEN DJLXBM='D3' THEN YBJE ELSE 0 end as 采購(gòu)付款金額 ,??
CASE WHEN [DJLXBM]='D3' THEN [YBJE] ELSE 0 end as '采購(gòu)付款金額' ,? ? ?-- 字段不能 加 [] 中括號(hào)? ,別名 不能 加 '' 單引號(hào)?
case when DJLXBM='D3' then DJRQ else null end as 采購(gòu)付款時(shí)間,
case when DJLXBM='D2' THEN YBJE else 0 end AS 銷售收款金額,
case when DJLXBM='D2' then DJRQ else null end 銷售收款時(shí)間
FROM
ARAP_DJZB
本文摘自 :https://www.cnblogs.com/