|
Thx PaulW.
But I may not have fully followed your query... Learning MySQL
I am not able to figure out how to eliminating the PHP `for` loop.
I need to get the count(id), sum(billsec) for every 30 minute slot between 8am & midnight.
Example:
count(id), sum(billsec) for time between 8.00 - 8.30
count(id), sum(billsec) for time between 8.30 - 9.00
count(id), sum(billsec) for time between 9.00 - 9.30
count(id), sum(billsec) for time between 9.30 - 10.00
For the above loop I am depending on php's `for` which I understand is wrong because it results in multiple mysql queries.
Need help with a more efficient method to do this.
Thx
|