Re: "Union all" and "UNION" ???? Return the same result or not ??
Date: 26 Jan 2004 00:37:03 -0800
Message-ID: <a1d154f4.0401260037.37fddf96_at_posting.google.com>
kenny_60559_at_yahoo.com (KENNY L. CHEN) wrote in message news:<83f59352.0401232325.61c22285_at_posting.google.com>...
> Thank you for your response.
>
> What I expect is the get the top one record from the tables.
> Originally I use
> "UNION" to sort the selection result from the tables then pick up the
> top one record. However, it causes performance problem when the tables
> become huge.
> That is why I try to use "UNION ALL" to avoid unnecessary sorting.
>
> According to advice from you , it seems "UNION ALL" doesn't work as
> what I expected. I am looking forward if you or anyone can help me to
> design a
> statement to give me the correct result efficiently.
>
Flado's response is correct. Obviously you didn't even try it. Because you don't understand his answer?
Sybrand Bakker
Senior Oracle DBA
Received on Mon Jan 26 2004 - 09:37:03 CET