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: analytic functions vs subquery

Re: analytic functions vs subquery

From: GreyBeard <Fuzzy.GreyBeard_at_gmail.com>
Date: Fri, 25 Feb 2005 16:52:41 GMT
Message-Id: <pan.2005.02.25.17.53.14.201164@gmail.com>


On Fri, 25 Feb 2005 13:50:50 +0100, Cris Carampa wrote:

> GreyBeard wrote:
>

>> One question for clarification:  is there only one possible 'NUM' value
>> for each 'ID' value?

>
> Yes. Sorry for not having specified this in my first post.
>
> Kind regards,

Then I'd suggest you use an inline view ....

SELECT sum(num)
  FROM ( SELECT DISTINCT id, num

           FROM thetab)
;

If this is foreign to you, please consider investing in the book "Mastering Oracle SQL" (http://www.oreilly.com/catalog/0596006322/) as you are missing a whole swack of capabilities in Oracle (and other real RDBMSs).

FGB Received on Fri Feb 25 2005 - 10:52:41 CST

Original text of this message

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