Home Forums SQL Server 2008 T-SQL (SS2K8) how to concatenate row columns and joined in another table RE: how to concatenate row columns and joined in another table

  • Hi,

    Try:

    SELECT

    t1.OtherVisaID,

    t1.Name,

    t1.Company,

    STUFF( (SELECT ';' + t3.Description

    FROM Table2 as t2

    JOIN Table3 as t3

    ON t3.OtherVisaID = t2.OtherVisaID

    WHERE

    t2.OtherVisaID = t1.OtherVisaID

    FOR XML PATH(''), TYPE).value('.', 'varchar(max)')

    ,1, 1, '') as ListOfVisa,

    FROM Table1 as t1

    Hope this help.