I have two tables one contain the next
___________________________________
|| Hospital Table ||
||_______________________________||
|| Hospital_no || Hospital_name ||
|| ||
and the other
___________________________________
|| Doctor Table ||
||_______________________________||
|| Doctor_no || Hospital_no ||
|| ||
which doctor.Hospital_no linked with Hospital.Hospital_no and i wont to get
______________________________________________________
|| Hospital_name | number of doctors in the hospital
|| ||
how can i do that
try this:
select HP.Hospital_name,COUNT(DT.Doctor_no) as
NoOfDoctors
from HospitalTable HP
Left join DoctorTable DT
ON HP.Hospital_no=DT.Doctor_no
GROUP BY HP.Hospital_name
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments