加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 数据库 > MySql > 正文

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

发布时间:2020-05-23 17:50:54 所属栏目:MySql 来源:互联网
导读:select length(abcdefg) english, length() korean from dual 这将返回以下.english korean 7 21 是否有任何函数返回字符数而不是字符字节?我的意思是我需要的是english korean 7 7 最佳答案见the manual: R

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()会做你想要的.

(编辑:安卓应用网)

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

    推荐文章
      热点阅读