Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> "Union all" and "UNION" ???? Return the same result or not ??

"Union all" and "UNION" ???? Return the same result or not ??

From: KENNY L. CHEN <kenny_60559_at_yahoo.com>
Date: 23 Jan 2004 02:34:10 -0800
Message-ID: <83f59352.0401230234.210b7b56@posting.google.com>

Dear experts,

I have two tables in my Oracle 8i database: TEST (COL1,COl2,REC_NO) and TEST1 (COL1,COL2,REC_NO).

Both tables are unique-indexed on (COL1,COL2,REC_NO).

I think the following SQL commands will return the same result but one of my friends don't think so. He said "QUERY 1" will return 1 unsorted record (ROWNUM < 2 ) first then sort the result (ORDER BY COL1 ASC, COL2 ASC, REC_NO ASC).
In "QUERY 2" , "UNION" will sort first then return the first distincted record.
But I can't duplicate the situation he said.

AM I WRONG ??? Please advise and thank you.

KENNY CHEN

Received on Fri Jan 23 2004 - 04:34:10 CST

Original text of this message

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