Column 'Status' in where clause is ambiguous
生活随笔
收集整理的這篇文章主要介紹了
Column 'Status' in where clause is ambiguous
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
錯誤提示:
?
解決:
在Mapper文件中,多表關聯查詢中有相同的字段,在查詢條件里,沒有指定別名。
<where><if test="customerName"> bub.CustomerName like CONCAT('%',#{customerName},'%' )</if><if test="status != null"> and bub.Status = #{status}</if><if test="startTime!= null and startTime != ''">AND? DATE_FORMAT(bub.transactionTime,'%y-%m-%d') >=DATE_FORMAT( #{startTime},'%y-%m-%d')</if><if test="endTime!= null and endTime != ''">AND? DATE_FORMAT(#{endTime},'%y-%m-%d')>=DATE_FORMAT(bub.transactionTime,'%y-%m-%d') </if>?</where>在這里status要加上主表的別名,就可以了。
總結
以上是生活随笔為你收集整理的Column 'Status' in where clause is ambiguous的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Use Chunks.groupsIte
- 下一篇: Vue单文件组件与vue-loader