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: Stuck with simple Update

Re: Stuck with simple Update

From: What's in a namespace <xml_at_ns.com>
Date: Wed, 22 Nov 2006 22:58:45 +0100
Message-ID: <4564c819$0$327$e4fe514c@news.xs4all.nl>

<pankaj_wolfhunter_at_yahoo.co.in> schreef in bericht news:1164214715.712398.192420_at_f16g2000cwb.googlegroups.com...
>
> Gary Floam wrote:
>> For any row that has one of the id's null, the entire row would sum to
>> null
>> and not be included in the second query but the other id's in the row
>> would
>> contribute to the sums in the query. So the first query includes more
>> terms
>> than the second.
>>
>> Hope this helps.
>>
>> "Robert Klemme" <shortcutter_at_googlemail.com> wrote in message
>> news:4sjamdFvi6gkU1_at_mid.individual.net...
>> > On 22.11.2006 16:48, pankaj_wolfhunter_at_yahoo.co.in wrote:
>> >> Greetings,
>> >> This may sound a stupid question but I dont know where else to go.
>> >>
>> >> SQL> SELECT SUM(id1) - (SUM(id2) + SUM(id3)) RESULT
>> >> 2 FROM table1
>> >>
>> >> RESULT
>> >> ----------
>> >> 225584455
>> >>
>> >> SQL> SELECT SUM(RESULT_TMP) RESULT
>> >> 2 FROM (
>> >> 3 SELECT id1 - (id2 + id3) RESULT_TMP
>> >> 4 FROM table1
>> >> 5 );
>> >
>> > This should be equivalent to
>> >
>> > select sum(id1 - (id2 + id3)) result
>> > from table1;
>> >
>> >> RESULT
>> >> ----------
>> >> 225572755
>> >>
>> >> Why am I getting two different results.
>> >> What am I dng wrong here?
>> >>
>> >> I am using Oracle 10g Enterprise Edition
>> >> Any help would be greatly appreciated.
>> >
>> > And you are sure that the data did not change in between? Other than
>> > that
>> > numeric issues (rounding errors or data type limits) come to mind.
>> >
>> > robert
>
> Thanks ppl. I really feel like kicking myself :-)
>

There may be some volunteers do do that for you! (Just kidding, interesting post! I'll keep this one in mind for when I have to put together a test next time!)

Shakespeare
(What's in a sum?) Received on Wed Nov 22 2006 - 15:58:45 CST

Original text of this message

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