Skip site navigation (1) Skip section navigation (2)

two table comparison: find a mismatch?

From: Web Manager <web(at)inter-resa(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: two table comparison: find a mismatch?
Date: 2000-07-28 20:54:58
Message-ID: 3981F322.1CFE9A47@inter-resa.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hello,

here is to table:
                               Table "city"
   Attribute    |    Type     |                  Modifier
----------------+-------------+---------------------------------------------
 city_id        | smallint    | not null default
nextval('seq_city'::text)
 region_id      | smallint    |
 region_tour_id | smallint    |
 country_id     | smallint    |
 name_fr        | varchar(40) |
 name           | varchar(40) |
 url_id         | smallint    |


                             Table "region"
 Attribute |    Type     |                   Modifier
-----------+-------------+----------------------------------------------
 region_id | smallint    | not null default nextval('seq_region'::text)
 country_id| smallint    |
 name_fr   | varchar(40) |
 name      | varchar(40) |
 address   | boolean     |
 url_id    | smallint    | 


I whant to fins a "hole" in the linkage... a region number in the city
table is not in the region table any more.

How can I do that?

Where is the city.region_id <> region.region_id

Thanks!
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Andre Paquin

Responses

pgsql-sql by date

Next:From: Ross J. ReedstromDate: 2000-07-28 21:44:37
Subject: Re: two table comparison: find a mismatch?
Previous:From: Henry LafleurDate: 2000-07-28 16:18:08
Subject: RE: RE: Re(2): optimize sql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group