chr()函数将ASCII码转换为字符:字符 –》 ASCII码;
ascii()函数将字符转换为ASCII码:ASCII码 –》 字符;
在oracle中chr()函数和ascii()是一对反函数。
chr()函数示例:
SQL> select chr(65) from dual;
CHR(65)
——-
A
accii()函数示例:
SQL> select ascii(‘A’) from dual;
ASCII(‘A’)
———-
65
取出当前字段中最大的字母,并计算出下一个字母:
SELECT CHR(ASCII(max(SUBSTR(UPPERCD,1,1)))+1)
FROM exps_code_lm
chr()函数可以输出的特殊字符:
Post a comment now »
本文目前不可评论
Sorry, the comment form is closed at this time.
No comments yet.