Hi guys,
I have records that look like the following
In queryname there is values called chargeddata and proxydata. i would like to get a sum of the downloaded amounts from these 2 values across each hour per day.
i have the following SQL which only adds the chargeddata amount and not the proxydata
Any help would be much appreciated
I have records that look like the following
Code:
custname | custgroup | queryname | subnet | day | hour | dbytes | ubytes
----------+---------------+-------------+--------------+-----+------+----------+--------
cee | SOHO DSL User | chargeddata | 202.137.73.2 | 1 | 0 | 53516 | 0
cee | SOHO DSL User | chargeddata | 202.137.73.2 | 1 | 1 | 54703 | 0
cee | SOHO DSL User | chargeddata | 202.137.73.2 | 1 | 2 | 52161 | 0
cee | SOHO DSL User | chargeddata | 202.137.73.2 | 1 | 3 | 58765 | 0
cee | SOHO DSL User | chargeddata | 202.137.73.2 | 1 | 4 | 58648 | 0
In queryname there is values called chargeddata and proxydata. i would like to get a sum of the downloaded amounts from these 2 values across each hour per day.
i have the following SQL which only adds the chargeddata amount and not the proxydata
Code:
select day,hour,sum(dbytes)
from custresults_200311
where custname='cee'
and (queryname='chargeddata' or queryname='proxydata') group by day,hour
Any help would be much appreciated