I need the results to look like:
PatientID Doctors Patient1 3 Patient2 2 Patient3 1
The booked table looks like this
You are looking for count(distinct):
count(distinct)
select b.PatientID, count(distinct b.DoctorID) as NumDoctors from Bookings b group by b.PatientID;