To know doctors who have done 15 or more episodes from tables:
Table 1
and
I have written this code:
select
d.DoctorName
from
tblDoctor d, tblEpisode e
where
e.DoctorId = d.DoctorId
group by
d.DoctorId, d.doctorname
having
count(d.DoctorID) > 15;
My output:
Now I want to create a stored procedure which will output a variable containing a comma-delimited list of the doctors who have done 15 or more episodes.
Can someone help me how to do it?