SQL..Sum two rows
- by Cha
Sample data:
LOCATION NAME LABEL1 LABEL2 SERVICE TIME
NY Andrew A B HOUSE 2555
NY Andrew A B CAR 35
NJ Copley C A HOUSE 1025
NY Copley A B HOUSE 650
VA Dalton D C PET 25
What I want to do ias add another column where in it shows sum(Time) of rows with same data except for the Service.Also, the services that I need are only the sum of car and house.Is this possible? If not can you help me with the right query
Sample output I need:
LOCATION NAME LABEL1 LABEL2 SERVICE TIME SUM
NY Andrew A B HOUSE 2555 **2590**
NY Andrew A B CAR 35
NJ Copley C A HOUSE 1025 1025
NY Copley A B HOUSE 650 650