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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help needed for select query

Re: Help needed for select query

From: Robert M. Gary <robert.gary_at_nospam_osi.com>
Date: Fri, 26 Oct 2001 14:20:33 -0700
Message-ID: <3BD9D3A1.71881529@nospam_osi.com>


Use the UNION operator.
Example I have is...

 SELECT 2, cls.name, mo.name, rel.name

             FROM   class cls, mo mo,
                    relate rel, morelate mor
             WHERE         mor.mo1 = :morelate_mo1
                       AND mo.mo = mor.mo2
                       AND cls.class = mo.class
                       AND rel.relate = mor.kind
             UNION ALL
             SELECT 1, cls.name, mo.name, rel.name
             FROM   class cls, mo mo,
                    relate rel, morelate mor
             WHERE         mor.mo2 = :morelate_mo1
                       AND mo.mo = mor.mo1
                       AND cls.class = mo.class
                       AND rel.relate = mor.kind
             ORDER BY 1 DESC, 3, 4;

Notice the "UNION ALL". There are other forms of union you can find in your PL/SQL book. Received on Fri Oct 26 2001 - 16:20:33 CDT

Original text of this message

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