mysql 1066解决方法_MySQL查询语法帮助:错误#1066-表格/别名不唯...
我有四個表,user,user_billingprofile,user_shippingprofile和user_address.
用戶:userId,dateCreated
user_billingprofile:userId,地址
user_shippingprofile:userId,地址
user_address:隨機地址廢話
這是我必須一目了然地獲取用戶帳單和運輸資料的查詢.
SELECT * FROM `user`
JOIN `user_billingprofile` ON `user`.`userId` = `user_billingprofile`.`userId`
JOIN `user_address` ON `user_billingprofile`.`currentAddress` = `user_address`.`addressId`
JOIN `user_shippingprofile` ON `user_shippingprofile`.`currentAddress` = `user_address`.`addressId`
JOIN `user_address` ON `user_shippingprofile`.`currentAddress` = `user_address`.`addressId`
我收到錯誤:#1066-不是唯一的表/別名:’user_address’.
有沒有一種方法可以進行簡單的聯接,即在同一查詢中兩次訪問一個表并將兩個結果分開?最好使用某種表前綴…
我在這里迷路了.我知道我可以很容易地在兩個單獨的查詢中執行此操作,但是我想學習如何一次完成這樣的操作.
非常感謝您的任何幫助/建議/指導,謝謝!
總結
以上是生活随笔為你收集整理的mysql 1066解决方法_MySQL查询语法帮助:错误#1066-表格/别名不唯...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 水塔清洗机器人_最全的中央空调清洗流程
- 下一篇: linux cmake编译源码,linu