Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Query question
Hi - I have a question about a query I'm struggling with - please
redirect me if this is not an appropriate place to ask.
I've been trolling the net for hours trying to find a solution to this, but obviously I am dumb :o)
What I have is two tables, one with projects and another with personnel linked to projects:
PROJECTS
- projectID (pk)
LINKED PERSONNEL
- projectID (fk into PROJECTS)
So, LinkedPersonnel is in a many-to-one relationship to Projects. i.e: a project can have many personnel, all with different roles.
What I want to do is to select data from Projects, but including the person who plays the 'Primary Investigator' role for that project. Baring in mind that:
I can't restrict using the WHERE clause, since that removes projects which have no PI.
I've tried various forms of subqueries, but to date, with no luck.
If anyone can help, I'd appreciate it. Apologies for being thick =) Received on Sat Jun 02 2007 - 21:50:29 CDT