MySQL: “Column 'column_name' in where clause is ambiguous”

前端 未结 3 1823
长情又很酷
长情又很酷 2021-01-20 04:37

I JOIN 2 tables

for example

table_A
+---------+-----------+-----------+
| user_id | ticket_id | user_name |
+---------+-----------+-----------+

table_B
         


        
相关标签:
3条回答
  • 2021-01-20 04:58

    There are a similar issues with MS SQLServer where version 2000 is accepting some ambiguous queries and the 2005 would throw an error. Basically the newer versions seem to be more strict.

    As a general rule you should use the same DB version both on Test server and on Production server to avoid this type of behaviour where a piece of code works on the test machine and fails on production.

    0 讨论(0)
  • 2021-01-20 05:17

    What SQL mode are your two servers in? I could imagine that one is set to be more strict than the other.

    0 讨论(0)
  • 2021-01-20 05:20

    I think Tomalak is right - there is a strict mode in the MySQL Administrative settings that may resolve your issue on the issue.

    I recall you select it during db creation, but you can adjust it from the Admin GUI.

    There are some significant bugs in MySQL right now, you may want to consider moving to SQL Server Express if you can...

    Sun is in financial trouble and I'm not surehow MySQL will end up.

    0 讨论(0)
提交回复
热议问题