I have a table called Appointments displaying time slots for booking an appointment.
id | time start | time end | caseno
1 | 800 | 830 | null
2 | 800 | 830 | null
3 | 900 | 930 | AB-111
4 | 900 | 930 | null
I need to display available appointment slots where CaseNo
is null. However, there are two time slots available each time (8am, 830am, 900am, etc.).
What query do I use to display the columns: Apn_Id
, Apn_TimeStart
and Apn_TimeEnd
avoiding to display duplicates and only taking available time slots (caseno = null
)?