赞
赏
LENGTH 函数是求字符串的字节长度,使用 UTF8 编码的字符集,汉字是 3 字节,数字或者字母是一个字节。本章使用的建表语句如下:
CREATE TABLE `tb_func` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `num` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; insert into tb_func (name,num) values ('haike',0); insert into tb_func (name,num) values ('嗨客网',1000); insert into tb_func (name,num) values ('hai',0);
LENGTH描述
语法