【发布时间】:2021-02-11 00:41:08
【问题描述】:
PostgreSQL 如何获取以 5 位开头和空格开头的列中的条目总数?
【问题讨论】:
标签: sql string postgresql count where-clause
PostgreSQL 如何获取以 5 位开头和空格开头的列中的条目总数?
【问题讨论】:
标签: sql string postgresql count where-clause
你想要一个正则表达式匹配吗?
select count(*) from mytable where col ~ '^\d{5}\s'
col 是您要过滤的列的名称。正则表达式细分如下:
^ beginning of the string
\d{5} five digits
\s one space
【讨论】: