$stridnex = "SELECT a.department, COUNT(DISTINCT b.issue_id) as OPEN , COUNT(DISTINCT a.issue_id) as CLOSE FROM ims_job a , ims_job b WHERE a.status = '0' AND b.visible_ <> '0' AND a.visible_ <> '0' GROUP BY a.department";
output
[{"department":"","OPEN":"187","CLOSE":"7"},{"department":"Admin","OPEN":"187","CLOSE":"13"},{"department":"BU Operations","OPEN":"187","CLOSE":"1"},{"department":"Business Development","OPEN":"187","CLOSE":"8"},{"department":"Credit and Collection","OPEN":"187","CLOSE":"5"},{"department":"Finance","OPEN":"187","CLOSE":"1"},{"department":"Human Resource","OPEN":"187","CLOSE":"23"},{"department":"ICT-MIS","OPEN":"187","CLOSE":"6"},{"department":"Medical Affairs","OPEN":"187","CLOSE":"2"},{"department":"NurtureMed","OPEN":"187","CLOSE":"1"},{"department":"Operations","OPEN":"187","CLOSE":"7"},{"department":"Quality Management","OPEN":"187","CLOSE":"8"},{"department":"Sales","OPEN":"187","CLOSE":"4"},{"department":"Trade Marketing","OPEN":"187","CLOSE":"1"}]
What I have tried:
I got a problem in OPEN column, while i got the correct output for close column. can you help me with this? Im using mysql. and will use my json for moris chart.