因為也只合併一個欄位。
以下繼續
原本的SQL
select rtrim(vch_no)+','
from podl
where podl.c_cfm='Y' and podl.c_cls <>'Y'
and podl.item_no = 'EP050008'
and podl.WAHO_NO <> 'J'
and podl.WAHO_NO <> 'J0'
order by VCH_NO
加上
FOR XML PATH('')
變成
select rtrim(vch_no)+','
from podl
where podl.c_cfm='Y' and podl.c_cls <>'Y'
and podl.item_no = 'EP050008'
and podl.WAHO_NO <> 'J'
and podl.WAHO_NO <> 'J0'
order by VCH_NO
FOR XML PATH('')
0 意見:
張貼留言