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 -> How to find the rows that are different between a table and it's sub view.

How to find the rows that are different between a table and it's sub view.

From: <bay_dar_at_yahoo.com>
Date: Tue, 12 Jun 2007 09:06:13 -0700
Message-ID: <1181664373.635427.53390@a26g2000pre.googlegroups.com>


Hi, I'm trying to write a sql statement to find the rows that present in table A but not in table B. Actually Table B is a view of A, so all values of B are guaranteed to be in Table A (but not the other way around). But I've never written onc of these reverse kind of queries and could use some advice.

For instance, the tables have the following values, where the IP and PORT are PK's:

Table A

IP                  PORT
127.0.0.1       55
127.0.0.2       55
127.0.0.5       22
127.0.0.2       33
127.0.0.2       36
127.0.0.6       55

Table B
IP                  PORT
127.0.0.1       55
127.0.0.2       55
127.0.0.5       22

The question is how can I write a query to produce the last 3 rows in Table A that are not in Table B?

Thanks. Received on Tue Jun 12 2007 - 11:06:13 CDT

Original text of this message

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