PostgreSQL,FROM后面的结尾代表什么?

PostgreSQL, what does the ending after FROM stand for?

例如

select * from table1 rel

rel 是什么意思?

还有

select * from ( select id from table1) main where (data)principal.

mainprincipal 是什么意思?它们不是关键字和任何东西。

这是一个别名,看看文档: https://www.w3schools.com/sql/sql_alias.asp

或来自 postgresql 的此处: https://www.postgresql.org/docs/current/static/queries-table-expressions.html#QUERIES-TABLE-ALIASES

PostgreSQL 假定 "rel" 是 "table1" 的别名,一旦保留字 "AS" 不是必需的。第二种情况也一样。

干杯

尼考