select user_id, a.room_id, room_type, datediff(checkout_time, checkin_time) days from guestroom_tb a inner join ( select info_id, room_id, user_id, substring_index(checkin_time,' ',1) checkin_time, substring_index(checkout_time,' ',1) checkout_time from checkin_tb ) b on a.room_id = b.room_i...