加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

mysql不同语言的Length()返回不同的大小

发布时间:2020-12-11 23:45:54 所属栏目:MySql教程 来源:网络整理
导读:select length('abcdefg') english,length('???????') koreanfrom dual 这将返回以下. english korean7 21 是否有任何函数返回字符数而不是字符字节? 我的意思是我需要的是 english korean7 7 最佳答案见the manual: Returns the length of the string str,

select 

length('abcdefg') english,length('???????') korean

from dual

这将返回以下.

english korean
7       21

是否有任何函数返回字符数而不是字符字节?

我的意思是我需要的是

english korean
7       7
最佳答案 见the manual:

Returns the length of the string str,measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five 2-byte characters,LENGTH() returns 10,whereas 07001 returns 5.

CHAR_LENGTH()会做你想要的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读