If I query a table which exists in two different schemas but has the same name what determines which table is used?
For example I have table
Bar which exists in both
foo, if I execute the statement below which one is returned:
SELECT * FROM Bar
I thought this was determined by the users default schema but doesn't appear to be the case.
I ask because I have found queries written by someone else who is not specifying the schema name yet the database being queried has the same tables in different schemas for ETL.