创建测试表,添加测试数据 1 PG create table pgtest as select ‘mm,lll,kkk’ as test 2 oracle create table oracletest as select ‘mm,lll,kkk’ as test from dual 计算元素个数(既逗号个数) select length(translate(test,‘,’||test,‘,’))+1 as num from tablename Oracle还可以使用函数regexp_count select regexp_count(test,‘,’)+1 from tablename