If you want to have columns from both tables, your SQL should look like
this:

 

Select 

                a.col1 as "Alias1",

                a.col2 as "Alias2",

                b.col1 as "Alias3",

                b.col2 as "Alias4"

From

                Table1 a,

                Table2 b

Where 

                a.col1 = b.col2 (or whatever your join criteria is)

 

HTH,

Charles

 

From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Joe DeSouza
Sent: Monday, January 29, 2007 12:55 PM
To: [email protected]
Subject: [ARSLIST] OT: Creating a view from 2 tables using SQL...

 

** 

I have table1 with Col1 and Col2

I have table2 with Col1 and Col2

 

I need to create a single view from both these tables, say view 1 where
Col1 of the view has every value that is in Col1 of both the tables and
Col2 of the view has all the values of Col2 of both the tables... There
is something wrong with the sql that I am writing resulting in a
'ORA-00957: duplicate column name'.

 

Could anyone point me to the syntax to write the above? Note that this
is not a conditional view - the view should basically contain all the
rows of both the tables basically 'merging' the 2 tables...

 

Cheers
 

Joe

 

________________________________

Everyone is raving about the all-new Yahoo! Mail beta.
<http://us.rd.yahoo.com/evt=42297/*http:/advision.webevents.yahoo.com/ma
ilbeta> 

__20060125_______________________This posting was submitted with HTML in
it___


_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to