Geeks With Blogs
Baskar B.V SQL - BI Consultant July 2008 Entries
Column Pivot using COALESCE
Column Pivot using COALESCE command: I read this in an article today and thought worth sharing with you. DECLARE @val VARCHAR(1000) SELECT @val = COALESCE(@val,'') + col1 + ';' FROM table1 SELECT @val The above command would concatinate the output of the column col1 in table1(say 100 rows) into a single column value. We can avoid using cursors ......

Posted On Thursday, July 3, 2008 2:32 PM

Copyright © Baskar B.V | Powered by: