CREATE TABLE doctor( patient CHAR(13), docname CHAR(30) );
Say I had a table like this, then how would I display the names of the doctors that have
Another alternative using CTE:
with cte_DocPatients as ( select docname, count(*) as patientCount from doctor group by docname ) select docname, patientCount from cte_DocPatients where patientCount = (select max(patientCount) from cte_DocPatients)