sql 報錯 ambiguous


 

 

 left join 左聯表 where條件查詢時 

<if test="status != null  and status != ''"> and status = #{status}</if>

沒有聲明是哪一個表,兩表均有status字段

報錯Column 'status' in where clause is ambiguous

解決方案:查詢多張表時給每張表取名,表名.字段來表示


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM