Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> SQL syntax help
I need to construct a query (Oracle 8i)
Each parent record may have many child records.
I want to find parents for which the children do _not_ have a particular conditional.
One complication is that I can't simply filter on "not <condition>" since almost every parent I want to find will probably have some of the conditional children.
Simple Example
RecNo Condition
(parent) (in child)
1 A 2 B 3 A 3 B
If I just ask for records that don't contain "A", the return will include records 2 and 3. But one of the children of record three has the condition I am filtering for.
***NOW THE QUESTION***
I assume the following approach will work:
Link Parent and Child tables
What SQL syntax will accomplish this? It's not a traditional self-join
<??>
TIA,
John
Received on Wed Jan 30 2002 - 12:27:50 CST
![]() |
![]() |