I have table MailSummary
:
Columns:
Send(Int), Reply(Int), SRT(Nvarchar(10)), NAME(Nvarchar(10))
|Send| Reply| SRT| Name|
------------------------
| 100| 8| 10| B|
| 30| 2| 20| R|
| 5| 0| 30| S|
-----------------------
I want to transform the table and get a new result set like:
Sum(Send), Sum(Reply)
and show the name in columns and the value of SRT under the new columns
|Send| Reply| B | R | S |
-------------------------
| 135| 10| 10| 20| 30|
How can I do it in a SQL query?