From: Richard Sitompul <richard@orbisindonesia.com>
To: Johannes Lochmann <j.lochmann@i-penta.at>
Cc: pgsql-admin@postgresql.org
Subject: Re: How the query please!
Date: Wed, 4 May 2005 11:55:54 +0700 (WIT)
Message-ID: <33787.202.81.37.29.1115182554.squirrel@202.81.37.29> (raw)
In-Reply-To: <200505040631.48380.j.lochmann@i-penta.at>
References: <33995.202.81.37.29.1115107252.squirrel@202.81.37.29>
<6.1.2.0.2.20050503080723.03272f48@mail.hightowergroup.com>
<33263.202.81.37.29.1115172586.squirrel@202.81.37.29>
<200505040631.48380.j.lochmann@i-penta.at>
Hi folks,
Thanks for all, I found it. I use this query.
(((( SELECT tbl_product1.part_number, tbl_product1.product_name
FROM tbl_product1
UNION ALL
SELECT tbl_product2.part_number, tbl_product2.product_name
FROM tbl_product2)
UNION ALL
SELECT tbl_product3.part_number, tbl_product3.product_name
FROM tbl_product3)
UNION ALL
SELECT tbl_product4.part_number, tbl_product4.product_name
FROM tbl_product4)
UNION ALL
SELECT tbl_product5.part_number, tbl_product5.product_name
FROM tbl_product5)
UNION ALL
SELECT tbl_product6.part_number, tbl_product6.product_name
FROM tbl_product6;
> On Wednesday 04 May 2005 04:09, Richard Sitompul wrote:
>
> Hello Richard!
>
>> I have six table_product, for example :
>> table_product_1
>> table_product_2
>> table_product_3
>> table_product_4
>> table_product_5
>> table_product_6
>>
>> in table_product_1 until table_product_6 have field part_number and
>> product_name. I want to ask here, how the query to get the part_number
>> and
>> product_name in one view(product_view).
>
> hm. are you searching for something like this, perhaps?
>
> create view product_view
> as
> select
> part_number
> ,product_name
> from table_product_1
>
> union
>
> select
> part_number
> ,product_name
> from table_product_2
>
> union
>
> ...
>
>> Any body can help me again?
>
> Is it this what you where searching for?
>
> HAND && HTH
>
> Johannes
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
--
>>Richard Sitompul<<
Software Engineer
PT. Orbis Indonesia
http://www.orbisindonesia.comhttp://richardsstp.3wsi.net
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: richard@orbisindonesia.com, j.lochmann@i-penta.at
Subject: Re: How the query please!
In-Reply-To: <33787.202.81.37.29.1115182554.squirrel@202.81.37.29>
References: <33995.202.81.37.29.1115107252.squirrel@202.81.37.29> <6.1.2.0.2.20050503080723.03272f48@mail.hightowergroup.com> <33263.202.81.37.29.1115172586.squirrel@202.81.37.29> <200505040631.48380.j.lochmann@i-penta.at> <33787.202.81.37.29.1115182554.squirrel@202.81.37.29>
* 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