Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Newbie SELECT ... NOT IN query problem
Hi Jacob,
I'm not totally clear on your needs, but is there a way of getting at this with a MINUS query? i.e. subtracting the translations already done from the pending ones?
Here's an example of what I'm asking:
SQL> SELECT * FROM TRANSLATES_FROM;
1 1 1 2 1 3 2 1
4 rows selected.
SQL> SELECT * FROM TRANSLATES_TO;
1 1
1 row selected.
SQL> SELECT * FROM TRANSLATES_FROM
2 MINUS
3 SELECT * FROM TRANSLATES_TO;
1 2 1 3 2 1
3 rows selected.
I hope this is helpful is some way.
Steve
Jacob Nordgren wrote:
> Hi everybody,
>
> I'm having a hard time figuring out this query, but I think it isn't
> so hard if anyone with a little experience look at it.
>
> This is a part of a system used for keeping control of texts and which
> text that should be translated.
>
> What I want to find out is which texts (TRANSLATED_TEXT.ID) that a
> specific translator should translate. Texts that the translator should
> translate are the texts where there already exists texts that he can
> translate from and at the same time there are missing texts in
> languages that he can translate to.
>
> These are the tables:
>
> TRANSLATOR
> ID NUMBER (PK)
>
> TRANSLATES_FROM
> TRANSLATORID NUMBER (PK)
> LANGUAGEID NUMBER (PK)
>
> TRANSLATES_TO
> TRANSLATORID NUMBER (PK)
> LANGUAGEID NUMBER (PK)
>
> LANGUAGES
> ID NUMBER (PK)
> NAME VARCHAR2 (2) -- example "en"
>
> TRANSLATION
> TRANSLATED_TEXT_ID NUMBER (PK)
> LANGUAGE_ID NUMBER (PK)
> TEXT VARCHAR2 (4000) -- example "Can you help me?" if language is "en"
>
> TRANSLATED_TEXT
> ID NUMBER (PK)
> NAME VARCHAR2 (200) -- this is an internal name, example
> "can_you_help"
>
> I've experimented a lot but I don't think you will have any use of the
> queries that I've produced... I think I should use "NOT IN", but I'm
> not sure...
>
> Thank you for your help!!
>
> / Jacob
Received on Wed Apr 11 2001 - 11:53:24 CDT