Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help needed for select query
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