开发者社区> 问答> 正文

postgresql中有能查看指定字符在一个字符串中出现次数吗??

postgresql中有能查看指定字符在一个字符串中出现次数吗??
本问题来自云栖社区【PostgreSQL技术进阶社群】。https://yq.aliyun.com/articles/690084 点击链接欢迎加入社区大社群。

展开
收起
游客886 2019-06-12 16:07:51 4928 0
1 条回答
写回答
取消 提交回答
  •  ?column? 
    ----------
           10
    (1 row)
    
    postgres=# select array_length(regexp_split_to_array('hhhhhhhhhh123h12h22h2h2h3hh3','2h'),1)-1;
     ?column? 
    ----------
            4
    (1 row)
    2019-07-17 23:37:03
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PostgresChina2018_刘东明_PostgreSQL并行查询 立即下载
认识PostgreSQL中与众不同的索引 立即下载
PolarDB for PostgreSQL三节点功能介绍 立即下载

相关镜像