MySQL Forums
Forum List  »  Newbie

Re: Illegal mix of collations for operation 'concat_ws' Error 1271
Posted by: Bhanu Nadendla
Date: September 11, 2008 01:33AM

Hi Tran,


I have found the workaround.

The reason is, in the follwoing column I have used the CASE function and the CASE functions result set datatype is undefined.I have used the CAST function to convert it to CHAR and it was working fine.

Final syntax:
select
CONCAT_WS('',TRIM(Col1),CAST((CASE when LENGTH(col2)=0 then '' when col2 IS NULL then '' when LENGTH(col2)=1 then '' else ',' end) as CHAR),col2,',',col3 , ',' , col4) AS ADDRESS
from
LOCATION l


Thanks
Bhanu Nadendla

Options: ReplyQuote


Subject
Written By
Posted
Re: Illegal mix of collations for operation 'concat_ws' Error 1271
September 11, 2008 01:33AM


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.