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: Holger Baer <holger.baer_at_science-computing.de>
Date: Wed, 04 Jun 2003 16:25:12 +0200
Message-ID: <3EDE0148.7080401@science-computing.de>


gospar wrote:
> Maybe you didn't understand the problem, but a simple query (if you tought
> so) won't solve it.
> The following IS NOT a solution for example 1 (Give me all persons who speak
> English AND German):
>
> SELECT p.PERSON_ID, p.NAME
> FROM LANGUAGE_SKILL l, PERSON p
> WHERE p.PERSON_ID=l.PERSON_ID AND l.LANG_ID=1 AND l.LANG_ID=2;
>
> Maybe I'm really missing something, but I think that is not the case.
>

Just think about what you're asking the database for:

How in the world would it be possible for a given language_skill entry to have at the very same time two (or more) different values?

I think Jimmy understood your problem perfectly well (as I do). He just wanted to encourage you to first lookup easy syntax problems in any SQL Book of your choice (the Oracle SQL Reference springs to mind) rather than post to this NG.

Now to help you at least getting started: AND is the wrong relational operator.

Cheers,

Holger Received on Wed Jun 04 2003 - 09:25:12 CDT

Original text of this message

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