错误信息:Column 'SalesMarketID' in where clause is ambiguous
来源:互联网 发布:如何删掉淘宝评价图片 编辑:程序博客网 时间:2024/05/17 07:44
使用mysql数据库进行左右连接查询的时候出现错误提示 Column 'id' in where clause is ambiguous。
这个错误in where clause is ambiguous多半是因为多表查询的时候几个表中同时出现了某个相同的列名,而在查询条件WHERE后面又没有指定是那个表,而引起的
又或者是查询结果里面有两个相同的列名,而没有指定是哪个表使用的时候可以这样,mysql查询前面加表名可避免出现错误Column 'id' in where clause is ambiguous
<!-- 获取优惠券的列表 -->
<select id="getCouponByCondition" parameterType="pd" resultType="Page">
SELECT C.*,S.MarketName,CU.CurrencyName FROM coupon C
LEFT JOIN salesmarket S ON S.SalesMarketID=C.SalesMarketID
LEFT JOIN currency CU ON CU.CurrencyID=C.CurrencyID
WHERE 1=1
<if test="pd.SalesMarketID != null and pd.SalesMarketID != ''">
and C.SalesMarketID=#{pd.SalesMarketID}
</if>
</select>
1 0
- 错误信息:Column 'SalesMarketID' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- Column 'Email' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- Column 'is_valid' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- Column ' ' in where clause is ambiguous
- column 'typeid' in where clause is ambiguous
- column in where clause is ambiguous MySQL异常
- 数据库异常:“Column 'CODE' in where clause is ambiguous”
- mysql Column 'dbvalue' in where clause is ambiguous解决方案
- mysql Error:1052 Column 'xxx' in where clause is ambiguous
- 错误代码: 1052 Column 'sys_date' in where clause is ambiguous
- where clause is ambiguous
- Integrity constraint violation: 1052 Column "order_id" in where clause is ambiguous
- Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous
- 2030 汉字统计
- String
- 手写LinkList
- 结束 adb.exe 进程后仍然提示“adb server is out of date.” 解决办法
- ssh2框架的搭建(二)
- 错误信息:Column 'SalesMarketID' in where clause is ambiguous
- hdu 2896 病毒侵袭 ( ac 自动机 )
- ctf之简单编程,字符统计
- QTcreator 编译 ROS package
- 实现垂直进度条
- 设计模式-----简单工厂
- poj-1198
- this和super的使用
- ural1057Amount of Degrees-数位dp