Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NULLS in union of two tables
On 2 Jun 1998 14:26:43 GMT, jperonto_at_engr.latech.edu (Julie A.
Peronto) wrote:
>I am creating a view that is the union of two tables that hold different
>information about like objects. There are some fields that exist in
>both tables & other fields that exist in one or the other table. The
>union will hold a combination of the two. For example, if the tables
>are called table_1 & table_2, then both table_1 & table_2 have a field
>called wr_no, table_1 has a field called wr_type, and table_2 has a
>field called wr_status. wr_type & wr_status are not related to each
>other in any way. I want to create a view that unions the two tables in
>such a way that the view has the fields wr_no, wr_type, wr_status.
>
I believe what you need to perform is a JOIN, not a UNION. I think the following command will create the view you need:
CREATE VIEW v1 AS
SELECTa.wr_no, a.wr_type, b.wr_status FROM table_1 a, table_2 b WHERE a.wr_no=b.wr_no;
Hope this helps
Nuno Guerreiro Received on Tue Jun 02 1998 - 10:14:43 CDT
![]() |
![]() |