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 Help

Re: SQL Help

From: James <james_lorenzen_at_allianzlife.com>
Date: Tue, 20 Apr 1999 19:01:57 GMT
Message-ID: <7fiiv3$86r$1@nnrp1.dejanews.com>


What you have written will result in a cartesian product, ie each row will be returned from TABLE_A once fro every row in TABLE_B matching the criteria. But if that is what is needed, try this: "select TABLE_A.* from TABLE_A, TABLE_B where TABLE_A.VAL1 > TABLE_B.VAL2 ;" HTH James

In article <371c99f3_at_newsread3.dircon.co.uk>,   "Paul Wiles" <paul_at_adzi.com> wrote:
> Sorry, I didn't finish off the demo query. Here is the message again:
>
> I'm in the process of rewriting some Transact SQL Sybase code to Oracle
> PL/SQL.
>
> Oracle does not appear to accept embedded subqueries of the form:
>
> select * from TABLE_A
> WHERE
> (VAL1 - (select VAL2 from TABLE_B)) > 0;
>
> (i know this can be rewitten as select (COL_A,COL_B...) from TABLE_A,TABLE_B
> where VAL1 > VAL2 but the actual queries are more complex and I'd rather not
> rewrite then in this form if I can help it
>
> Thanks
>
> Paul
>
> Paul Wiles wrote in message <371c965d_at_newsread3.dircon.co.uk>...
> >I'm in the process of rewriting some Transact SQL Sybase code to Oracle
> >PL/SQL.
> >
> >Oracle does not appear to accept embedded subqueries of the form:
> >
> >select * from TABLE_A
> > WHERE
> > (VAL1 - (select VAL2 from TABLE_B)
> >
> >(i know this can be rewitten as select (COL_A,COL_B...) from
> TABLE_A,TABLE_B
> >where VAL1 > VAL2 but the actual queries are more complex and I'd rather
> not
> >rewrite then in this form if I can help it
> >
> >Thanks
> >
> >Paul
> >
> >
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Apr 20 1999 - 14:01:57 CDT

Original text of this message

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