View error in PostgreSQL

前端 未结 4 1331
南旧
南旧 2021-01-01 18:41

I have a large query in a PostgreSQL database. The Query is something like this:

SELECT * FROM table1, table2, ... WHERE table1.id = table2.id...
         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 18:53

    If only join columns are duplicated (i.e. have the same names), then you can get away with changing:

    select *
    from a, b
    where a.id = b.id
    

    to:

    select *
    from a join b using (id)
    

提交回复
热议问题