一、ascii函数只取给予参数中第一位的asc值
SQL> select ascii('nihao') from dual;
ASCII('NIHAO')
--------------
110
SQL> select ascii('n') from dual;
ASCII('N')
----------
110
二、substr是按字节取字符
SQL> select substr('guojun',1,1) from dual;
S
-
g
SQL> select substr('guojun',1,2) from dual;
SU
--
gu
SQL> select substr('郭军哈',1,1) from dual;
S
-
?
SQL> select substr('郭军哈',1,2) from dual;
SU
--
郭
--因为英文占两个字节,中文占四个字节