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 |
|
mukhan85
Starting Member
46 Posts |
Posted - 2008-08-27 : 11:52:40
|
| Hi how can I group by similar rows from the following table:name value1 value2 ----- ----------- ----------- Cancelled 85 33 Completed 716 108 No Stat/Closed 33 3 Open 36 17 Rejected 5 0 Successful/Closed 314 131 Backed Out/Closed 8 0 Cancelled 63 0 Successful/Closed 311 0 Unsuccessful/Closed 1 0 as you can see there are 2 rows with "Successful/Closed" and 2 rows with "Cancelled"Thank you. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-27 : 11:55:12
|
[code]select name, sum(value1), sum(value2)from yourtablegroup by name[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-27 : 11:55:40
|
SELECT Name, SUM(Value1), SUM(Value2)FROM Table1GROUP BY Name E 12°55'05.25"N 56°04'39.16" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-27 : 11:55:55
|
 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|