|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Getting count and quantity on combined columns
I need help with this query
this is the database Location, Quantity, Purpose, Cable EX: Atlanta, 2, March Concert, xlr_50ft Chicago, 3, July Concert, rca_25ft Atlanta, 1, March Concert, xlr_25ft Atlanta, 5, March Concert, rca_15ft If given we want the 'March Concert', i need the query to return 8, Atlanta but maybe i'm just stupid and this is really easy but I can't think of this right now at 8 o'clock on friday night, any help? |
|
#2
|
|||
|
|||
|
select sum(quantity), purpose
from <table> where purpose = 'March Concert' group by purpose |
|
#3
|
|||
|
|||
|
select sum(quantity) as TotalQuantity, Location
from <mytable> where purpose='March Concert' group by Location |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Getting count and quantity on combined columns |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|