MySQL & PHP - Not unique table/alias

前端 未结 4 1141
攒了一身酷
攒了一身酷 2021-02-12 12:21

I get the following error listed below and was wondering how do I fix this problem.

Not unique table/alias: \'grades\'

Here is the code I think

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-12 12:46

    You need to use an alias if you're using the same name twice:

    SELECT FROM grades g1 ... 
    JOIN grades g2 ON g1.id = g2.grade_id ...
    

    Be sure that you intended to use the same name twice, and didn't mistakenly enter the same name twice.

提交回复
热议问题