From: Nils Zonneveld <nils@mbit.nl>
To: pgsql-sql@postgresql.org
Subject: Re: Combine query views into one SQL string
Date: Fri, 07 Sep 2001 10:10:32 +0200
Message-ID: <3B9880EB.2B3294E9@mbit.nl> (raw)
References: <63e57aa8.0109060835.33719290@posting.google.com>
<9n8fip$get$1@narses.hrz.tu-chemnitz.de>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: nils@mbit.nl
Subject: Re: Combine query views into one SQL string
In-Reply-To: <3B9880EB.2B3294E9@mbit.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox