I have to write query to update roomid comparing rooms based on time slots
I have this table data
customerid appointmentfrom appointmentto roomid
----------------------------------------------------------------------------
1 2020-07-18 10:00:00.000 2020-07-18 11:30:00.000 1
2 2020-07-18 10:30:00.000 2020-07-18 11:15:00.000 2
3 2020-07-18 11:15:00.000 2020-07-18 11:59:00.000 2
I shouldn't allow customerid 1 to update his roomid as 2 as roomid 2 has been booked for that time slots
customerid 1 is trying to update roomid as 2 , but i need to check whether the appointmentfrom and appointmentto he is booking is available or not