Calculating Peak Time using SingleStore?

Hi all,

I have a player_sessions table, that consists of a joined_at and quit_at dates, I need to calculate out of these sessions which time had the most online. How can I do this?

It’ll be visually shown on a dashboard, with optional date filters, just not sure if single store has anything out the box with this.

Thank you!

It sounds like you are trying to compute total play time by sessions. If the joined_at and quit times are datetime(6), say, then you can sum up the timestampdiff(joined_at, quit, microsecond) and group by player_id or something like that.