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)