I'm trying to execute this concat query in mysql
SELECT CONCAT(if(fName,fName,''),Name) From Student
Error:
#1271 - Illegal mix of collations for operation 'concat'
This is due to collections difference, you can solve by converting the two strings or columns to one collection say UTF8
CONCAT(CAST(fName AS CHAR CHARACTER SET utf8),CAST('' AS CHAR CHARACTER SET utf8))
This will solve :)
you can check more about casting in MySQL here MySQL Casting
1.4m articles
1.4m replys
5 comments
57.0k users