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

Home -> Community -> Usenet -> c.d.o.misc -> Re: [SQL] Subqueries help needed.

Re: [SQL] Subqueries help needed.

From: <michael_bialik_at_my-deja.com>
Date: Sat, 19 Feb 2000 19:26:39 GMT
Message-ID: <88mqpd$443$1@nnrp1.deja.com>


Hi.

 Try following :

  SELECT claim_number
  FROM claims cl
  WHERE
    secondary_claim_no = ( SELECT min ( secondary_claim_no )

                           FROM claims cl_in
                           WHERE
                             cl.main_claim_no = cl_in.main_claim_no )

 HTH. Michael.

In article <38AE4436.63945001_at_fisystem.fr>,   Alain Kreienbuhl <akreienb_at_fisystem.fr> wrote:
> Hello,
>
> I wish to do the following
>
> SELECT claim_number
> FROM clains
> WHERE main_claim_number , secondary_claim_number IN (
> SELECT main_claim_number , min
> (secondary_claim_number )
> FROM clains
> GROUP BY main_claim_number )
> (this may look wired but some how this is what the query must do )
>
> My question is actually focusing on the following part of the query
>
> ... WHERE col1, col2 IN (
> SELECT col1, col1
> ....
> )
>
> In remember in SQL2 hand book seeing something like that. But Oracle
> says :
>
> "ORA-00920: invalid relational operator
> Cause: A search condition was entered with an invalid or missing
> relational operator. "
>
> (I have a real dirty query doing the above but It's to diry to be
> used...)
>
> Thanks for help.
>
> Alain.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Feb 19 2000 - 13:26:39 CST

Original text of this message

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