mysql查询每个直播间每个用户最早进入时间和最晚退出时间

myself_sql = 'select room_id,source_id user_id,min(cast(at as datetime)) joinroom,max(cast(at as datetime)) leaveroom ' \
'from `event_history` where room_id={} and source_type=1 group by source_id ORDER BY source_id desc'.format(room)
posted @ 2018-12-31 21:23  xiaojinniu425  阅读(1141)  评论(0编辑  收藏  举报