SELECT HOUR(session_start) AS session_hour,
       AVG(TIMESTAMPDIFF(MINUTE, session_start, session_end)) AS avg_duration
FROM user_sessions
GROUP BY session_hour
ORDER BY session_hour;