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

Home -> Community -> Usenet -> c.d.o.server -> Re: distinct with <>

Re: distinct with <>

From: Matt <matt.selph_at_gmail.com>
Date: 9 May 2005 12:40:49 -0700
Message-ID: <1115667649.107508.321100@o13g2000cwo.googlegroups.com>


Hello. The easiest way to solve this problem is by using the MINUS keyword. The MINUS keyword returns rows that are in one table but not in the other.

Consider both your tables (say, TBLA and TBLB) have the following two columns:

NAME VARCHAR2(255),
EMAIL VARCHAR2(255) If you want to know who has an e-mail address in TBLA but not in TBLB, run the following query:

SELECT name
FROM tbla

   MINUS
SELECT name
FROM tblb;

I would suggest reading the Oracle documentation on MINUS, UNION, UNION ALL, and INTERSECT. Received on Mon May 09 2005 - 14:40:49 CDT

Original text of this message

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