user5182503
user5182503

Reputation:

SQL: is it normal to use column name with schema name?

Lets suppose I have two schemas in one DB: public and private. In both schemas I have the same table - my_table with the same columns. So is it normal to do the following:

SELECT public.my_table.my_col FROM public.my_table?

I am trying to do it with H2 but get exception in ResultSet - column not found. Is it not normal or it's not normal for H2?

Upvotes: 2

Views: 250

Answers (1)

Renzo
Renzo

Reputation: 27414

You should write:

SELECT my_col FROM public.my_table

since column names are already evaluated in the table(s) specified in the query.

Upvotes: 1

Related Questions