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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL - filtering data based on AND condition

Re: SQL - filtering data based on AND condition

From: gospar <no.spam_at_my.place>
Date: Thu, 5 Jun 2003 09:51:52 +0200
Message-ID: <bbmso1$954$1@sunce.iskon.hr>

"Holger Baer" <holger.baer_at_science-computing.de> wrote in message news:3EDE2630.1040603_at_science-computing.de...
>
> PS: I'll get accused of helpfulness, but to get this thread stopped: what
you need is
> a selfjoin on language_skill.
>

Correct me if I'm wrong, but that isn't the solution for my problem (maybe I didn't explain my problem quite well?):
If I use the self-join I must change the FROM clause of my query, and that is what I specifically don't want to do (if you look at my initial posting you will see that I need to build a query which works for any number of rows in LANGUAGE_SKILL and PERSON, and that I want to get my result by ONLY changing the WHERE clause of that statement), e.g. this IS NOT a solution:

SELECT p.PERSON_ID, p.NAME
FROM LANGUAGE_SKILL l1, LANGUAGE_SKILL l2, PERSON p WHERE l1.PERSON_ID=p.PERSON_ID AND l2.PERSON_ID=p.PERSON_ID AND l1.LANG_ID=1 AND l2.LANG_ID=2;

because if I wanted to find a person who speaks 4 languages I would need 4 LANGUAGE_SKILL tables in my FROM clause, and that is what I want to avoid (I should only change my WHERE clause).

Regards,
gospar Received on Thu Jun 05 2003 - 02:51:52 CDT

Original text of this message

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