Re: Help!!! on SQLPlus query

From: Jurij Modic <jmodic_at_src.si>
Date: Fri, 09 Apr 1999 21:12:14 GMT
Message-ID: <370e6cfa.3879437_at_news.arnes.si>


On Fri, 09 Apr 1999 12:56:30 GMT, "Hongbo Zhang" <hongbozhang_at_yahoo.com> wrote:

>Hi,
>
>I am new on Oracle. I have 4 following tables:
>...[SNIP]...
>
>Would you please help me to realize this query with Oracle Sqlplus: for
>every MEDECIN,
>find the name of hospital he works and count the nomber of patients he
>treats.

Try:

SELECT m.name_m, h.name_h, count(p.*)

  FROM med_pat_hos p, medecin m, hospital h
  WHERE p.code_m = m.code_m
    AND p.code_h = h.code_h

  GROUP BY m.name_m, h.name_h;

>Thanks
>
>Hongbo

HTH, Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Apr 09 1999 - 23:12:14 CEST

Original text of this message