MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:silk Date:March 13 2004 11:10am
Subject:Re: utf8 - left function
View as plain text  
Problem tested using both version 4.0.18 and 4.1.1

This query gets first byte of utf8 character, not two bytes

If I use

SELECT LEFT(FieldName, 2) AS FirstLetter, COUNT(*) FROM TableName GROUP BY
FirstLetter


gets right utf8 characters but others wrong

for example;

+--------+-------+
| Ai     |     1 |
| Ak     |     9 |
| Ar     |    33 |
| İ       |     8 |


I couldn't find 4.1.2 dev source for testing. Can you tell me how I can get
it please.

Does anybody knows another solution except getting dev source?


----- Original Message -----
From: "Jeremy March" <jeremy_march@stripped>
To: <mysql@stripped>
Sent: Saturday, March 13, 2004 5:34 AM
Subject: re: utf8 - left function


> > Hi,
> >
> > I need this query;
> >
> > SELECT LEFT(FieldName, 1) AS FirstLetter, COUNT(*) FROM TableName
> > GROUP BY FirstLetter
> >
> > my datas in utf8 format. I can't get first characters of the datas in
> > utf8 format but others is ok.
> >
> > Any suggestion?
> >
> > Thank you
>
> It works for me.  I'm using the development source 4.1.2.  Maybe the
> problem has already been fixed. You are using a 4.1.x version, right?
> It definitely would not work before 4.1.



Thread
utf8 - left functionsilk13 Mar
re: utf8 - left functionJeremy March13 Mar
  • Re: utf8 - left functionsilk13 Mar
Re: utf8 - left functionJeremy March13 Mar