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

  • If you can use SQLCLR you could use GROUP_CONCAT for SQL Server[/url] and write your SQL like this:

    SELECT t1.OtherVisaID,

    t1.Name,

    t1.Company,

    dbo.GROUP_CONCAT_D(t3.DESCRIPTION, ';') AS ListOfVisa

    FROM Table1 AS t1

    JOIN Table2 AS t2 ON t1.OtherVisaID = t2.OtherVisaID

    JOIN Table3 AS t3 ON t3.OtherVisaID = t2.OtherVisaID

    GROUP BY t1.OtherVisaID,

    t1.Name,

    t1.Company;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato