Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL query problem
I'm trying to select records in a table where the multiple occurances
of data in one field are not matched by data in another. Difficult to
explain (or bad explaination), I guess thats why I'm struggling to
write the sql.
As an example of what I'm trying to do , if we have the following data:
Person, Fruit Bought
======,==========
Bob, Apple Tom, Kiwi Jim, Peach Bob, Kiwi Tom, Pear Jim, Apple Tom, Kiwi
I want to return the people who have not bought an Apple or a Peach. ie Tom in this example.
The table I'm looking at is pretty big so I'm looking for a low cost solution.
I've been trying to use "where not exists" but I'm not getting anywhere.
Thanks for any help.
Mike Received on Mon Jan 23 2006 - 08:51:59 CST
![]() |
![]() |