I have the following query:
SELECT count(*) as \'totalCalls\', HOUR(`end`) as \'Hour\'
FROM callsDataTable
WHERE company IN (
SELECT number
FROM pr
The generation of values from nothing is not an easy job (usually it's not even possible) in MySQL.
I suggest a simpler approach:
24
entries (totalCalls
, Hour
) with 0
as totalCalls
and the hours (from 0
to 23
) as Hour
. This is an easy task in any programming language.