I'm doing a select for a report of calls by carrier and each column of quantity, I have a select compound and that should return me the amount of calls from each carrier.
SELECT date(calldate) as 'Data',
(select count(*) FROM cdr where dstchannel like '%claro%' and (calldate between '2014-08-01' and '2014-08-11' ) ) as 'Claro',
(select count(*) FROM cdr where dstchannel like '%tim%' and (calldate between '2014-08-01' and '2014-08-11' ) ) as 'Tim',
(select count(*) FROM cdr where dstchannel like '%vivo%' and (calldate between '2014-08-01' and '2014-08-11' ) ) as 'Vivo',
(select count(*) FROM cdr where dstchannel like '%oi%' and (calldate between '2014-08-01' and '2014-08-11' ) ) as 'Oi',
(select count(*) FROM cdr where dstchannel like '%nextel%' and(calldate between '2014-08-01' and '2014-08-11' ) ) as 'Nextel'
FROM cdr where
(dstchannel regexp 'claro|Tim|vivo|oi|nextel')
and (calldate between '2014-08-01' and '2014-08-11' ) group by date(calldate)
The result that is returned is the same value in each row with the total, without separating by date.