solidDB判断字符串长度

[复制链接]
查看11 | 回复0 | 2009-7-22 15:23:20 | 显示全部楼层 |阅读模式
呵呵,用octet_length()来判断长度吧!和length()的区别是:length() -- 不包括尾部空格octet_length() -- 包括尾部空格例:create table aa(v varchar);Command completed successfully, 0 rows affected.insert into aa values('aaa');Command completed successfully, 1 rows affected.insert into aa values('bbb ');Command completed successfully, 1 rows affected.commit work;Command completed successfully, 0 rows affected.select * from aa;V-aaabbb2 rows fetched.select length(v), v from aa;LENGTH(V) V--------- -
3 aaa
3 bbb2 rows fetched.select octet_length(v), v from aa;OCTET_LENGTH(V) V--------------- -
3 aaa
4 bbb2 rows fetched.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行