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 |
|
mummy
Starting Member
9 Posts |
Posted - 2009-04-30 : 05:51:53
|
| Hi All,I have a below problem to show the multiple rows in a single row.Actual Table:Name Area BDD ISD SGGAAA XXX 0 0 10AAA XXX 0 20 0AAA XXX 30 0 0BBB YYY 0 0 15BBB YYY 0 20 0BBB YYY 30 0 0Expected Result:Name Area BDD ISD SGGAAA XXX 30 20 10BBB YYY 30 20 15Please help me. |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-04-30 : 05:57:37
|
| select name,area,max(bdd),max(isd),max(sgg) from tabl group by name,area |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-04-30 : 05:57:57
|
| select name,area,sum(BDD)as BDD,sum(isd) AS ISD, SUM(sgg) AS SGGfrom actualtablegroup by name,area |
 |
|
|
|
|
|