Posted by Ed Murphy on 06/05/07 16:50
Mirnes wrote:
> I have table with following structure:
>
> Cust Amount Type
> 1 150.00 1
> 1 100.00 2
>
> I would like to get query result:
>
> Cust Type1 Type2
> 1 150.00 0.00
> 1 0.00 100.00
>
> How to do this with query?
In addition to the CASE solution already posted, SQL Server 2005
allows some sort of explicit pivot functionality. I've never used
it, though, so I don't remember the syntax.
[Back to original message]
|