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: SELECT / UNION Giving Different Results

Re: SELECT / UNION Giving Different Results

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 01 Jul 2007 14:53:47 -0700
Message-ID: <1183326750.264016@bubbleator.drizzle.com>


Dereck L. Dietz wrote:

>> Ugly and a horrible misuse of keywords as you obviously know but there
>> is not a WHERE clause in sight which means this query is not performing
>> any filter of anything other than via your use of DISTINCT and UNION.
>>
>> So a few quick questions ... why DISTINCT and why UNION rather than
>> UNION ALL? Change UNION to UNION ALL and I'll bet you get what you think
>> are your missing records.
>>

>
> Would changing UNION to UNION ALL explain why it didn't work during the
> production run but DID during my test run of the same code? That's what's
> confusing me. If just using UNION can provide inconsistent results with the
> same source data that would mean a lot of changes in the code here (though
> if necessary it needs to be done).

Please stop top posting. Humans read from top-to-bottom. Thanks.

Do you understand the difference between UNION and UNION ALL? It would seem to me the answer to your question is likely "yes" and that you need to learn when it is appropriate to use each.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sun Jul 01 2007 - 16:53:47 CDT

Original text of this message

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