我的代码如下
ASturct * array[]
我想在最终结果中将FTPUsername和FTPPassword连接到Deliverylocation。
以上代码无效。如果我删除+ FTPUsername + FTPPassword,那么代码可以正常工作。
有人可以帮忙吗?
答案 0 :(得分:0)
如果在子查询中进行连接,以便可以在PIVOT
SELECT Customerid ,
CustomerName ,
[ftga.ihs.com] AS ftga ,
[Email Delivery] AS Email
FROM ( SELECT Customerid ,
CustomerName ,
AliasName ,
Deliverylocation ,
FTPUsername ,
FTPPassword ,
ConcatenatedValue = Deliverylocation + FTPUsername
+ FTPPassword
FROM [dbo].[tblCustomerDeliveryServerMapping] t1
INNER JOIN tblDeliveryServerDetails t2 ON t1.Deliveryserverid = t2.id
INNER JOIN tblcustomerinfo t3 ON t1.customerid = t3.id
) AS P PIVOT
( MAX(ConcatenatedValue) FOR AliasName IN ( [ftga.ihs.com],
[Email Delivery] ) ) AS PVT;