Creating View question 
Author Message
 Creating View question

I want to create a query as follow:

select * from t1,t2 where t1.nameid =t2.nameid

I can successfully give this command from SQL query view. But if I create a
view VIEW1 and embed it into the view it complains saying filed nameid is
not unique.

I need to specify the query by specifying every column of t1 and t2 like
select nameid,x,y,z,a,b,c, ...  
from t1,t2
where t1.nameid=t2.nameid

which I do not prefer to do if I have a choice.What is the trick?
Thanks in advance

- nitin



Thu, 04 Nov 1999 03:00:00 GMT
 Creating View question

Hello Nitin,

You can change the query

Quote:
> select * from t1,t2 where t1.nameid =t2.nameid

to
SELECT  t1.*,   t2.* FROM t1, t2 WHERE t1.nameid = t2.nameid

Since the column 'nameid' appears in both the tables, the view compilation
generates the error. By prefixing the table name, you will eliminating the
confusion.

Regards.

Rahul



Fri, 05 Nov 1999 03:00:00 GMT
 Creating View question

This somehow does not seem to work. I have the same field name in both
tables and it complains for that field name. Am I missing something in the
syntax?

-- nitin

Quote:

>Hello Nitin,

>You can change the query
>> select * from t1,t2 where t1.nameid =t2.nameid
>to
>SELECT  t1.*, t2.* FROM t1, t2 WHERE t1.nameid = t2.nameid

>Since the column 'nameid' appears in both the tables, the view
compilation
>generates the error. By prefixing the table name, you will eliminating
the
>confusion.

>Regards.

>Rahul



Fri, 05 Nov 1999 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Select statement used to create view question

2. creating view question

3. SQL Create View Question

4. Creating a local view using CREATE SQL VIEW

5. Creating a View Question....

6. Newbie question about creating a view

7. create view (Newbie question)

8. CREATE/DROP ANY VIEW question

9. Create View on dba_tab_columns question

10. Creating Views - an easy question.

11. Question on create view


 
Powered by phpBB® Forum Software