I need the results to look like:
PatientID Doctors Patient1 3 Patient2 2 Patient3 1
The booked table looks like this
I did this and it worked:
select PatientID as Patient, count(distinct(DoctorID)) as Doctors from Bookings, Patients group by PatientID;
Thank you for the help!