sql server 用for xml 实现oracle中wm_concat功能
1 SELECT [values]=stuff((SELECT ','+CASE i.invoice_type WHEN 1 THEN '通用服务发票' WHEN 2 THEN '增值税普通发票' WHEN 3 THEN '增值税专用发票' END 2 FROM m_invoice i 3 WHERE i.invoice_type>=1 4 GROUP BY i.invoice_type 5 ORDER BY i.invoice_type FOR XML PATH('')), 1, 1, '')