jjzjj

doctorid

全部标签

mysql - SQL select from inner join where count 大于

医生doctorid(PK)doctornamePatientpatientid(PK)patientnamedoctoridIhavethefollowingquerytogetthedoctorsdetailswiththenumberofpatientsthathe/sheconsults.assumeapatienthasonlyonedoctortoconsult.selectd.doctorid,d.doctorname,count(p.patientid)fromdoctordinnerjoinpatientpond.doctorid=p.doctoridgroupbyp