Postgres Invalid Reference to FROM Clause

Viewed 65

I am having a hard time finding what I am doing wrong here.

    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

I am getting the following error:

    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.

From what I've read I need to do some kind of join on g0, g1, and g2, but my database doesn't have a common column between them, so I can't do a join.

Any help would be greatly appreciated.

1 Answers
Related