Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
phrankbooth
Posting Yak Master
162 Posts |
Posted - 2011-11-01 : 13:34:15
|
| In the table below, I'd like to group by subtype, sum up the dr values and take AZ as the title.subtype dr titleATOZ 100.00 AZATOZ 200.00 AZ - EUATOZ 300.00 AZ - UKthis is what my result should be: ATOZ, 600.00, AZIt's the getting just AZ to one row that I'm having trouble with.Thanks! |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-11-01 : 13:40:22
|
| SELECT SubType, SUM(DR) AS DR, MIN(Title) AS TitleFROM myTableGROUP BY SubType |
 |
|
|
phrankbooth
Posting Yak Master
162 Posts |
Posted - 2011-11-01 : 13:48:29
|
| Perfect, thank you! You're beautiful :)--PhB |
 |
|
|
|
|
|