Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All

I want to create a view of two tables.
In both tables there are some columns in which null is not enable.
I want to insert all the columns from both the tables.
If there are some rows in any of the table.It should also go in the view.
Is it possible?
Posted

1 solution

hello,

you could try something like

select table1.*, table2.* from table 1 left join table2 on tbl1.key=tbl2.key
union
select table1.*, table2.* from table 2 left join table1 on tbl1.key=tbl2.key where tbl1.key is null

Thanks and I hope this sheds some light.

Aj
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900