Having an issue with the total count of column records with the group by query. my data should be shown like:
Call Status Call Results Percentage
Answering Machine 1 5.6%
DO NOT CALL 9 50.0%
Good Transfer 4 22.2%
Looking for Information 4 22.2%
(blank) 0.0%
Total Calls 18
I am using the following query to do my work. But yet i am taking hardcore "18" because the problem occurs here that how i can take whole column count with group by.
$result = mysqli_query($link, "SELECT vs.status_name,vl.call_date,SUM(vl.called_count) as Total,SUM(vl.called_count)/18*100 as percentage from vl_users vu,".$vicidial_log_table." vl,vicidial_list vi,vicidial_statuses vs where vl.call_date >= '2014-01-17 00:00:00' and vl.call_date <= '2016-10-17 23:59:59' group by vs.status_name limit 100000") or die(mysqli_error($link));
The number 18 above is the sum of the call result column.