我会非常清楚:在MySQL中创建视图而又没有该死的非法归类错误的解决方案是什么?
我的SQL代码是这样的(它有一些葡萄牙语单词),而我的数据库默认排序规则是latin1_swedish_ci
:和/或concat,因为完整的错误描述告诉我:归类(latin1_swedish_ci,IMPLICIT)和(utf8_general_ci,强制)操作“ coalesce”CREATE VIEW v_veiculos AS SELECT v.id, v.marca_id, v.modelo, v.placa, v.cor, CASE v.combustivel WHEN 'A' THEN 'Álcool' WHEN 'O' THEN 'Óleo Diesel' WHEN 'G' THEN 'Gasolina' ELSE 'Não Informado' END AS combustivel, marcas.marca, /*I think that the CONCAT and COALESCE below causes this error, when the next line the view works fine*/ CONCAT(marca, ' ', v.modelo, ' - Placa: ', v.placa, ' - Combustível: ', COALESCE(v.combustivel, 'Não informado')) AS info_completa FROM veiculos v LEFT JOIN marcas on(marcas.id = v.marca_id);
我认为错误原因是因为我使用coalesce
我会很清楚:在MySQL中创建视图而又没有该死的非法归类错误的解决方案是什么?我的SQL代码是这样的(它有一些葡萄牙语单词),而我的数据库...