Monthly Archives: April 2010

Crosstab Query (Rows to Columns)

First,  columns to rows are very simple with UNION: SELECT col1 as [new column]  FROM table1 UNION SELECT col2 FROM table1 UNION SELECT col3 FROM table1 This is very helpful when I need to run aggregate function on multiple columns: … Continue reading

Posted in SQL | Tagged | Leave a comment