X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 32066D70E2 for ; Sun, 4 Sep 2005 09:19:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61548-06 for ; Sun, 4 Sep 2005 12:19:21 +0000 (GMT) Received: from ihug-mail.icp-qv1-irony2.iinet.net.au (mail-iinet.icp-qv1-irony2.iinet.net.au [203.59.1.196]) by svr1.postgresql.org (Postfix) with ESMTP id F0025D709A for ; Sun, 4 Sep 2005 09:19:18 -0300 (ADT) Received: from 203-217-20-160.dyn.iinet.net.au ([203.217.20.160]) by ihug-mail.icp-qv1-irony2.iinet.net.au with ESMTP; 04 Sep 2005 20:19:19 +0800 Subject: joining two simular (but not identical tables) From: Neil Dugan To: pgsql-sql@postgresql.org Content-Type: text/plain Date: Sun, 04 Sep 2005 22:19:12 +1000 Message-Id: <1125836352.7221.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-6) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/25 X-Sequence-Number: 22572 I have two similar but not identical tables. I would like to create a view that combines the contents of both tables into a single view, where each record in each table is visible as a separate record in the view. table a Column | Type | Modifiers ---------------+-----------------------+----------- prcode | character varying(12) | descr | character varying(55) | rrp | numeric(10,5) | sugcusmkdn | numeric(6,2) | customerpr | numeric(7,2) | costpr | numeric(11,6) | lengths | character(1) | profitpercent | numeric(6,2) | table b Column | Type | Modifiers ---------------+-----------------------+----------- prcode | character varying(12) | descr | character varying(55) | rrp | numeric(10,5) | customerpr | numeric(7,2) | supdis | numeric(6,3) | costpr | numeric(11,6) | lengths | character(1) | profitpercent | numeric(6,2) | dnprice | numeric(7,2) | stcode | character varying(18) | dnprofit | numeric(5,2) | Thanks for any help. Regards Neil.