select distinct user_id, ci.room_id, room_type, sum(timestampdiff(day,date(checkin_time),date(checkout_time))) over(partition by user_id) as days from checkin_tb as ci left join guestroom_tb as gr on ci.room_id = gr.room_id where timestampdiff(day,date(checkin_time),date(checkout_time)) > 1 and c...