Thanks Fred,

Yes I figured that out.. I also needed to add 2 other values which weren't part 
of the table so what I did was exactly what you described UNION select 
'value1', 'value2' from dual

Rgds

Joe

----- Original Message ----
From: "Grooms, Frederick W" <[EMAIL PROTECTED]>
To: arslist@ARSLIST.ORG
Sent: Monday, January 29, 2007 3:26:09 PM
Subject: Re: Creating a view from 2 tables using SQL...

** 
It sounds like you are wanting to union the 2 tables into 1 view...
 
That would be something like:
   Create or Replace view1 
   (Col1, Col2)   
   AS   
   (Select Col1, Col2 from table1   
   UNION   
   Select Col1, Col2 from table2);   
 
Fred
 




From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] 
On Behalf Of Joe DeSouza
Sent: Monday, January 29, 2007 1:55 PM
To: arslist@ARSLIST.ORG
Subject: 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

__20060125_______________________This posting was submitted with HTML in it___

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

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

Reply via email to