Link to home
Start Free TrialLog in
Avatar of RustyZ32
RustyZ32Flag for United States of America

asked on

SQL Results horizontal

I found this sample online:

DECLARE @id_list VARCHAR(MAX) --varchar max works for SQL 2005 or above
 
SELECT @id_list = CASE WHEN @id_list IS NULL THEN CONVERT(VARCHAR,column1)
            ELSE @id_list + ',' + CONVERT(VARCHAR,column1) END
            FROM table1            
SELECT @id_list



which works great to display a single column horizontally but I need to display one column normally with the results of another horizontally:

Bob smith  |  09/12/2011, 09/13/2011, 09/15/2011    

in that example all dates with the name value bob smith.
ASKER CERTIFIED SOLUTION
Avatar of pivar
pivar
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RustyZ32

ASKER

worked great! thanks.