MySQL Forums
Forum List  »  French

Error Code: 1271. Illegal mix of collations for operation 'concat'
Posted by: Oumar TOURE
Date: April 21, 2017 02:13PM

Bonour à tous,
Lors de l'exécution de ma requete ci-dessous j'ai le message d'erreur suivant; Error Code: 1271. Illegal mix of collations for operation 'concat'

select CONCAT(prefixe,annee,mois,jours,LPAD(IF(CONCAT(t.lastAnnee,'-',t.lastMois,'-',t.lastJours)<> dateCourante,0, t.numero + 1), 4, '0')) as nouveau_code
from (SELECT
code,
MID(code, 1, 1) AS prefixe,
MID(code, 2, 4) AS lastAnnee,
MID(code, 6, 2) AS lastMois,
MID(code, 8, 2) AS lastJours,
MID(CURRENT_TIMESTAMP, 1, 4) AS annee,
MID(CURRENT_TIMESTAMP, 6, 2) AS mois,
MID(CURRENT_TIMESTAMP, 9, 2) AS jours,
MID(code, 10, 4) AS numero,
CURRENT_DATE as dateCourante
FROM demandeur
ORDER BY code DESC
LIMIT 1
) as t

Merci de m'aider.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.