Есть 2 запроса:
SELECT COUNT(schedule.id) AS Total, doctor_id, doctor.last_name FROM `schedule`
INNER JOIN doctor ON `schedule`.doctor_id = doctor.id
WHERE `date` BETWEEN '2017-06-06' AND '2017-08-06'
GROUP BY doctor_id
SELECT COUNT(schedule.id) AS Worked, doctor_id, doctor.last_name FROM `schedule`
INNER JOIN doctor ON `schedule`.doctor_id = doctor.id
WHERE `date` BETWEEN '2017-06-06' AND '2017-08-06' AND schedule.appointment_cnt > 0
GROUP BY doctor_id
Как объединить их таким образом, чтобы на выходе получить таблицу вида Total, Worked, doctor.last_name