Hi I have a table that list Spanish classes start and finish time as well as date and teacher.
I’m trying to write a MYSQL query that lists the that date each teacher has the most classes, the day which they are the busiest.
If there are days that tie I’d like to show both.
This is what I have so far but It only returns one date,even if there is a tie, I sense this is because I’m GROUPing on teacher at the end
SELECT teacher_no, date
FROM (
SELECT COUNT(date)AS counted,teacher_no,date
FROM Spanish
GROUP BY teacher_no,date
) AS t
GROUP BY teacher_no
Try this: