Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: UNION and ORDER BY
On Wed, 08 Nov 2000 20:25:22 GMT, shaikh74_at_my-deja.com wrote:
>Dear Oracle gurus:
>
>I have two SQL statements which are run through UNION and UNION ALL,
>and the results are exact same. They contain duplicate rows (rows
>which are in common within two SQLs). I would like to get distinct
>rows in the final result set. Also, in the final set I would them to
>run through ORDER BY clause. Your assistance values a million.
>Thanks a bunch. Please reply to shaikh74_at_visto.com
>Asad
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
From Oracle docs:
UNION ALL
All rows selected by either query, including all duplicates.
INTERSECT
All distinct rows selected by both queries.
MINUS
All distinct rows selected by the first query but not the second.
SELECT 'Brian' INTO Signature FROM Dual; Received on Wed Nov 08 2000 - 16:34:57 CST
![]() |
![]() |