Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help on SQL problem..
Hi, Evelyn.
Something like this should work...
select employee.* from employee,
(select count(*) num_of_projs from project) where num_of_projs =
(select count(*) from works_on where works_on.essn = employee.ssn)
Hope this helps
-Jeff
On Sat, 18 Sep 1999 01:31:27 +1000, "Evelyn" <onezero_at_post1.com> wrote:
>This is a multi-part message in MIME format.
>
>------=_NextPart_000_0012_01BF0175.86FB97E0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>Hi all,
>
>First of all, thank you for taking time to read my posting. I'm a =
>newbies in Oracle SQL and now i'm stuck with this particular problem, i =
>really appreaciate you can help me on this. Thanks in advance..
>
>I have 3 tables, and my problem is, i need to find the names of the =
>employee who works on every projects?
>
>Employee (fname, lname, ssn) -> ssn is the primary key
>Project (pname, pnumber, plocation, deptnum) -> pnumber (project =
>no) is the primary key
>Works_on (essn, pno, hours) -> essn (same as Employee's ssn) + pno =
>(same as Project's pnumber) is the primary key
>
>I thank you for helping me on this problem. Thanks a zillion!!
>
>--=20
>Cheers
>Evelyn
>17 Sept'99
>
>------=_NextPart_000_0012_01BF0175.86FB97E0
>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META content=3D"text/html; charset=3Diso-8859-1" =
>http-equiv=3DContent-Type>
><META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY>
><DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
><DIV> </DIV>
><DIV><FONT face=3DArial size=3D2>First of all, thank you for taking =
>time to=20
>read my posting. I'm a newbies in Oracle SQL and now i'm stuck with this =
>
>particular problem, i really appreaciate you can help me on this. Thanks =
>in=20
>advance..</FONT></DIV>
><DIV> </DIV>
><DIV><FONT face=3DArial size=3D2>I have 3 tables, and my problem is, i =
>need to find=20
>the names of the employee who works on every projects?</FONT></DIV>
><DIV> </DIV>
><DIV><FONT face=3DArial =
>size=3D2><STRONG>Employee</STRONG> =20
>(fname, lname, <U>ssn</U>) -> ssn is the primary key</FONT></DIV>
><DIV><FONT face=3DArial size=3D2><STRONG>Project</STRONG>=20
> (pname, <U>pnumber</U>, =
>plocation,=20
>deptnum) -> pnumber (project no) is the primary key</FONT></DIV>
><DIV><FONT face=3DArial size=3D2><STRONG>Works_on</STRONG> =
> =20
>(<U>essn, pno</U>, hours) -> essn (same as Employee's ssn) + pno =
>(same as=20
>Project's pnumber) is the primary key</FONT></DIV>
><DIV> </DIV>
><DIV><FONT face=3DArial size=3D2>I thank you for helping me on this =
>problem. Thanks=20
>a zillion!!</FONT></DIV>
><DIV><BR><FONT face=3DArial size=3D2>-- =
><BR>Cheers<BR>Evelyn</FONT></DIV>
><DIV><FONT face=3DArial size=3D2>17 Sept'99</FONT></DIV></BODY></HTML>
>
>------=_NextPart_000_0012_01BF0175.86FB97E0--
>
Received on Fri Sep 17 1999 - 13:51:40 CDT
![]() |
![]() |