Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f878Wp783834 for ; Fri, 7 Sep 2001 04:32:55 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f878Dhr03817 for pgsql-sql@postgresql.org; Fri, 7 Sep 2001 04:13:43 -0400 (EDT) (envelope-from news) From: Nils Zonneveld X-Newsgroups: comp.database.ms-access, comp.database.oracle, comp.databases.postgresql.sql, comp.databases.sybase, comp.databases Subject: Re: Combine query views into one SQL string Date: Fri, 07 Sep 2001 10:10:32 +0200 Organization: Nilsies little old network Lines: 35 Message-ID: <3B9880EB.2B3294E9@mbit.nl> References: <63e57aa8.0109060835.33719290@posting.google.com> <9n8fip$get$1@narses.hrz.tu-chemnitz.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@cistron.nl X-Mailer: Mozilla 4.75 (Macintosh; U; PPC) X-Accept-Language: nl,en To: pgsql-sql@postgresql.org X-Archive-Number: 200109/79 X-Sequence-Number: 4725 Maik wrote: > > With "Union" you can create one view. > Ciao Maik UNION wouldn't have the desired effect: the result of a UNION SELECT would look like this: ID AMOUNT 1 (table1.amount) 2 (table1.amount) . . . . 1 (table2.amount) 2 (table2.amount) What he wants is: ID TABLE1.AMOUNT TABLE2.AMOUNT 1 (amount) (amount) 2 (amount) (amount) . . . . . . You can achieve that result with an inner join (and even MySQL with it's rather restricted SQL subset supports an inner join). Nils -- Alles van waarde is weerloos Lucebert