我試圖使用聚結,不具備任何行如果沒有行,則返回「輸入文本」。 (排序規則的非法混合)
那些進入我得到這個工作
SELECT
COALESCE(t1.it, d.it_norow)
FROM (SELECT 0 as it_norow
FROM DUAL) as d
LEFT JOIN
(SELECT t1.itemText as it
FROM bullet_items as t1
WHERE t1.cst_name = 'Cust'
AND t1.bullet_id = 'BD1') as t1
ON 1 = 1
但是,當我改變了「0」雙表
SELECT
COALESCE(t1.it, d.it_norow)
FROM (SELECT 'Enter text' as it_norow
FROM DUAL) as d
LEFT JOIN
(SELECT t1.itemText as it
FROM bullet_items as t1
WHERE t1.cst_name = 'Cust'
AND t1.bullet_id = 'BD1') as t1
ON 1 = 1
我得到的錯誤Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'coalesce'
我怎樣才能使「輸入文字」工作時,有沒有行?
你能重現問題通過提供[*'Fiddle Demo' *](http://sqlfiddle.com/)? – 2014-08-29 18:50:18