Is it possible to join the three tables and return AppID as one string in the result set?
I want to achieve the following result set:
AccountID, OrderID, DocID, AppID
123 , 1 , D1 ,A1A2
I have written the following, but I can't get it to work (I am getting sytax error on line select @AppID = ....)
(select @AppID = @AppID + AppID from TableC c where c.DocID = b.DocID)
where a.AccountID = @AccountNumber
and a.AccountID *= b.AccountID
and a.OrderID *= b.OrderID
Can someone please give me some advice how to resolve this problem?