Postgres 对 FROM 子句的引用无效

Postgres Invalid Reference to FROM Clause

我很难找到我做错了什么。

    select * from prog_log as g0, order_line as g1, logstat as g2
    inner join channel as g3 on g3.chn_serial = g0.log_chn_id

我收到以下错误:

    invalid reference to FROM-clause entry for table "g0"
    LINE 2: inner join channel as g3 on g3.chn_serial = g0.log_chn_id
                                                ^
    HINT:  There is an entry for table "g0", but it cannot be referenced from this part of the query.

据我了解,我需要对 g0、g1 和 g2 进行某种连接,但我的数据库在它们之间没有公共列,因此我无法进行连接。

如有任何帮助,我们将不胜感激。

Postgres 中的逗号绑定比 JOIN 表达式弱;将 FROM 子句中的每个逗号更改为 CROSS JOIN。见 note in the relevant section of the docs.