嗨,我有一个表格测试如下
NAME
---------
abc1234
XYZ12789
a12X8b78Y9c5Z
我尝试找出字符串中数字和字符的数量
select name,length(replace(translate(lower(name),'abcdefghijklmnopqrstuvwxyz',' '),' ','')) as num_count,
length(replace(translate(name,'1234567890',' '),' ','')) as char_count
from test6;
它的执行很好,给出了输出
NAME NUM_COUNT CHAR_COUNT
abc1234 4 3
XYZ12789 5 3
a12X8b78Y9c5Z 7 6
但我的问题是不手动给出abcdefghijklmnopqrstuvwxyz
and有什么选择1234567890