|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
group by
Select sum(Val1) 'Value 1', sum(Val2) 'Value 2',
Case Valu3 When 'Green' Then 1 When 'Yellow' Then 1 When 'Orange' Then 2 When 'Red' Then 2 End From Table1 Group by Valu3 Value 1 Value 2 Valu3 59353881.0 56468059.0 1 10093672.0 10497598.0 2 19992340.0 24993682.0 2 How I can combine last two rows when valu3 = 2? |
|
#2
|
|||
|
|||
|
Hi,
Do you mean combine the last 2 rows of the output, as in sum them so you would have...? Value 1 Value 2 Valu3 59353881.0 56468059.0 1 30086012.0 35491280.0 4 Iain |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > group by |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|