報表格式:CODE PPD COLL PPD COLLCP C P CC C CPP P P我要實現根據CODE來自動相應填充PPD或COLL ?其中只有CODE這一字段在視圖中 ,這個視圖怎么寫才能實現上面的效果?請高手幫忙,謝謝了
1 回答

RISEBY
TA貢獻1856條經驗 獲得超5個贊
select code,case substring(code,1,1) when 'C' then '' else 'P' end as PPD,case substring(code,1,1) when 'P' then '' else 'C' end as COLL,case substring(code,2,1) when 'C' then '' else 'P' end as PPD,case substring(code,2,1) when 'P' then '' else 'C' end as COLL from xx
- 1 回答
- 0 關注
- 361 瀏覽
添加回答
舉報
0/150
提交
取消