Lets say the column containing date was named yourDateColumn
and the column containing status was named statusColumn
, you could do:
SELECT yourDateColumn,
SUM(statusColumn="On") as On,
SUM(statusColumn="Off") as Off
FROM yourTable
GROUP BY yourDateColumn
ORDER BY yourDateColumn