Kylo Ren
Kylo Ren

Reputation: 8813

Select Data from view vs Table of same name

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.

Upvotes: 2

Views: 2017

Answers (1)

David דודו Markovitz
David דודו Markovitz

Reputation: 44921

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

Upvotes: 2

Related Questions