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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: union, minus and order by

Re: union, minus and order by

From: <CHUCK_HAMILTON_at_qvc.com>
Date: Mon, 1 May 2000 10:01:18 -0400
Message-Id: <10484.104540@fatcity.com>


Turn the select into a dynamic view and use an order by...

select *
from (

   SELECT
         c1.Id ID, c1.Name CNAME, t.name TNAME    FROM blabla
   UNION ALL
   SELECT
         c1.Id ID, c1.Name CNAME, t.name TNAME    FROM blabla2
   MINUS
   SELECT
         c1.Id ID, c1.Name CNAME, t.name TNAME    FROM blabla3
)
ORDER BY 1,2,3;
--

Chuck Hamilton
Oracle DBA
Enterprise Technical Services

                                                                                                                   
                    G.Plivna_at_itsy                                                                                  
                    stems.lv             To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>       
                    Ext: NA              cc:     (bcc: CHUCK HAMILTON/QVC)                                         
                    Sent by:             Subject:     union, minus and order by                                    
                    root_at_fatcity.                                                                                  
                    com                                                                                            
                                                                                                                   
                                                                                                                   
                    04/30/00                                                                                       
                    02:04 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    ORACLE-L                                                                                       
                                                                                                                   
                                                                                                                   





Hi!

I have SELECT like this

SELECT
      c1.Id ID, c1.Name CNAME, t.name TNAME FROM blabla
UNION ALL
SELECT
      c1.Id ID, c1.Name CNAME, t.name TNAME FROM blabla2
MINUS
SELECT
      c1.Id ID, c1.Name CNAME, t.name TNAME FROM blabla3
;

The problem is how to get rows ordered by these three fields

Gints Plivna

--

Author:
  INET: G.Plivna_at_itsystems.lv

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may Received on Mon May 01 2000 - 09:01:18 CDT

Original text of this message

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