码上敲享录 > mysql实战经验分享 > 解决[Err] 1052 - Column 'STATUS' in where clause is ambiguous

解决[Err] 1052 - Column 'STATUS' in where clause is ambiguous

上一章章节目录下一章 2018-07-22已有6390人阅读 评论(0)

mysql关联查询报错:

[Err] 1052 - Column 'STATUS' in where clause is ambiguous


解决方法:

多表关联查询的时候有where语句中两个相同的列名STATUS,而没有指定是哪个表。

例如:

SELECT t.status

FROM book t

LEFT JOIN category t2 ON t.cid = t2.id

where status=0


本文地址:http://www.yayihouse.com/yayishuwu/chapter/1334

向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
1

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交