Re: oracle query

From: Vadim Tropashko <vadimtro_at_yahoo.com>
Date: Tue, 06 Feb 2001 17:17:28 GMT
Message-ID: <95pbis$db7$1_at_nnrp1.deja.com>


In article <95p2dm$4fp$1_at_nnrp1.deja.com>,

  Mark D Powell <markp7832_at_my-deja.com> wrote:

> In article <95movl$5hq$1_at_nnrp1.deja.com>,
> Vadim Tropashko <vadimtro_at_yahoo.com> wrote:
> > In article <95fl8f$21c$1_at_nnrp1.deja.com>,
> > Aloha Kakuikanu <alohakaku_at_yahoo.com> wrote:
> > > In article <95fcin$qgb$1_at_nnrp1.deja.com>,
 

> > > BTW, try to query Greatest Common Divisor -- I've read that
> > > SQL is incomplete, so you cannot calculate anything your way.
> >
> > select max(c.gcd) from
> > (select rownum as x from PHONES where rownum < 15) a,
> > (select rownum as y from PHONES where rownum < 15) b,
> > (select rownum as gcd from PHONES where rownum < 15) c
> > where gcd*x=6
> > and gcd*y=9
> >
> > (Those limitations are because the RDBMS I use comes with very
> > inefficient plan)
> >
> > You probably meant relational algebra, not SQL
> >
> Note that x is a character string so it must be enclosed in single
> quotes in Oracle.

Both SQRT and GCD queries run in oracle RDBMS, I tested.

> To select a power or square root in Oracle you would
> reference the function while a numeric constant could be retrieved by
> value:

>

> UT1> l
> 1 select 'x' as COL1,
> 2 sqrt(99) as COL2,
> 3 22
> 4* from dual
> UT1> /
>

> C COL2 22
> - ---------- ----------
> x 9.94987437 22
> This must be the answer original author was asking for:-)

Sent via Deja.com
http://www.deja.com/ Received on Tue Feb 06 2001 - 18:17:28 CET

Original text of this message