MS SQL matrix query
If you use Microsoft SQL and you want to do a query to turn some rows into columns, it can be tricky. I don't know what that type of query is called, I think some call it a matrix query or a cross-tab query or a pivot query. Here's how I've been able to write a pivot cross-tab matrix queries for Microsoft SQL Server including an extra variation for SQL Server 2005.
Syndicated 2008-02-07 04:09:24 from Dave Brondsema's Blog - Programming