Archives

Archive for October, 2007

Collation in MySQL CONCAT function

( MySQL )
 

This simple concat expression works in MySQL 4.1.21-standard: select CONCAT(DATE_FORMAT(dtmTest,”%Y-%m-%d”), ” – “, strType) FROM tbltest but not in MySQL 5.0.45-community-nt: Error Code : 1270 Illegal mix of collations (utf8_general_ci,COERCIBLE), (utf8_general_ci,COERCIBLE), (latin1_swedish_ci,IMPLICIT) for operation ‘concat’ (0 ms taken) Solution: use COLLATE thus: select CONCAT(DATE_FORMAT(dtmTest,”%Y-%m-%d”), ” – ” COLLATE utf8_general_ci, strType) FROM tbltest; This is relevant: [...]

 

google