Sunday 26 June 2011

Solucion: Illegal mix of collations for operation 'UNION'

Si por ejemplo tienes esta consulta SQL:


UNION ALL SELECT 1,2,3,table_name FROM information_schema.tables


Y recibes este error:

Illegal mix of collations for operation 'UNION'


Se soluciona con esto:


UNION ALL SELECT 1,2,3,UNHEX(HEX(table_name)) FROM information_schema.tables


Usando las funciones unhex() y hex() respectivamente

FUENTE


Publicado en tttony.blogspot.com

No comments:

Post a Comment