Re: creating VIEW of 2 tables
Posted in 1998
Dan Thibadeau wrote:
>
> I'm using SE 7.23 on HPUX 10.20
>
> Since you can't use UNION in a VIEW, I was wondering if there is another
> way to accomplish the following:
>
> - I have 2 customer profile tables. I would like to create a VIEW of
> the "like" fields in each table.
>
> cust_table1 (100k+ rows) cust_table2 (5k+ rows)
> name name
> addr addr
> phone phone
> data1
> data2
> data3
>
> - I would like to create a view of the UNION of these tables:
>
> all_customers (105k+ rows)
> name
> addr
> phone
>
> The closest I've come to an idea is:
>
> SELECT cust_table1.name, cust_table2.name
> cust_table1.addr, cust_table2.addr,
> cust_table1.phone, cust_table2.phone
> FROM bogus, OUTER cust_nonhp, OUTER cust_hp>
> Which creates a cartesian product of each table to "bogus". The table
> bogus has 1 row and 1 field. However this just gives an error.
>
> Thanks,
>
> Dan Thibadeau
> dant@rose.hp.com
In the mauals you can find the restrictions on views and (what a pitty)
unions are included - i agree with you the error message could be a
better one.