Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem figuring out subquery/outer join/count...

Re: Problem figuring out subquery/outer join/count...

From: Colin Mackenzie <cmackenz_at_nortel.com>
Date: Sun, 14 Jun 1998 00:43:48 -0400
Message-ID: <6lvkkd$apj@nbdchc4.ca.nortel.com>


Thanks Steve,

I had tried something similar using an outer join, but I must have been off on the syntax a bit. Your example works great...

Much appreciated, Colin.

Steve Davis wrote in message <3582ff8d.0_at_news.i-way.co.uk>...
>
>Colin,
>
>select
>e.month month,
>count(e.empnum) no_of_new_emps,
>count(g.serious) no_of serious,
>count(g.serious) / count(e.empnum) * 100 percent_serious
>from grievances g,
>emps e
>where g.empnum (+) = e.empnum
>and g.serious (+) = 'Yes'
>group by e.month
>
>should do it
>
>Note that this assumes that there cannot be more than one serious
>grievance for a single employee - otherwise the emplyee and grievance
>will be counted twice.
>
>Hope this helps,
>Steve
>
Received on Sat Jun 13 1998 - 23:43:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US