把多行转成一行 用空格分开

select
t1.ID as 销售合同标识,
t1.BillNO as 单据号,
t1.orderNo as 合同编号,
(select distinct '【' + salesorderno+'】'+' ' from SalesCompactOrder where parentid = t1.id for xml path('')) 销售订单号,
t1.Purchase as 购货单位,
t1.OrderPurchase as 订单购货单位,
t1.summoney as 合同总金额,
t1.Industry as 行业,
t1.Area as 区域,
t1.ReceiptType as 收款方式,
t1. PayTime as 付款时间,
t1. MakeTime as 制单时间,
t1. Employer as 业务员,
t1. SalesTime as 合同签订日期,
t1. SumCount as 合同总数量,
t1. passcount as 合同已勾数量,
t1. count as 合同未勾数量,
t1. SalesType as 合同类型,
t1. zhaiyao as 摘要
from SalesCompact t1

posted @ 2015-02-03 11:14  YyuTtian  阅读(281)  评论(0编辑  收藏  举报