From: | "Richard Sitompul" <richard(at)orbisindonesia(dot)com> |
---|---|
To: | "Johannes Lochmann" <j(dot)lochmann(at)i-penta(dot)at> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: How the query please! |
Date: | 2005-05-04 04:55:54 |
Message-ID: | 33787.202.81.37.29.1115182554.squirrel@202.81.37.29 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
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(at)postgresql(dot)org
>
--
>>Richard Sitompul<<
Software Engineer
PT. Orbis Indonesia
http://www.orbisindonesia.com
http://richardsstp.3wsi.net
From | Date | Subject | |
---|---|---|---|
Next Message | Mauri Sahlberg | 2005-05-04 09:47:57 | Re: A nightmare |
Previous Message | Johannes Lochmann | 2005-05-04 04:31:47 | Re: How the query please! |