[英]#1271 - Illegal mix of collations for operation 'UNION'
嘗試編寫選擇聯盟查詢,但始終得到此錯誤: #1271-操作'UNION'的排序規則的非法混合
MySQL查詢:
SELECT users.*, offices.name as office_name FROM huilo_daikiri.`users` left outer join offices on (offices.id=users.office_id) where users.id='120'
union all
SELECT users.*, offices.name as office_name FROM huilo_laroc.`users` left outer join offices on (offices.id=users.office_id) where users.id='185'
當我將其分開進行2個SELECT時-它可以工作。
我做錯了什么? 謝謝。
您在兩個表中的列具有不同的排序規則。 查看聯機叢書中的COLLATE關鍵字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.