Użyj Grupuj według tabeli tymczasowej z odrębnym pacjentem i lekarzem
select Patient, count(*)
from (
select distinct Bookings.PatientID as Patient ,DoctorID as Doctors
from Bookings ) as t
Group by Patient;
Użyj Grupuj według tabeli tymczasowej z odrębnym pacjentem i lekarzem
select Patient, count(*)
from (
select distinct Bookings.PatientID as Patient ,DoctorID as Doctors
from Bookings ) as t
Group by Patient;