Select Data from view vs Table of same name

1.8k Views Asked by At

I have a database where a view and a table have same name, when I try to execute query

select * from XXXXXXXXX

from where is this data coming from, view or table? Is there any explicit declaration syntax to tell, to where from select the data?

PS: the DB owner is different so I can't change the structure of view/table or names either.

1

There are 1 best solutions below

3
On BEST ANSWER

Objects names are unique per owner, so the table and the view can't be defined for the same owner.
Qualify the table/view name with the right owner.

select * from table_owner.XXXXXXXXX

select * from view_owner.XXXXXXXXX