postgresql判断字符串是否是数字

select '12.41212' ~ '^[0-9\.]+$'
=> true

select 'Service' ~ '^[0-9\.]+$'
=> false

条件语句

是:select * from t_tab t where t.t_column ~ '[1]+$'

否:select * from t_tab t where t.t_column !~ '[2]+$'


  1. 0-9. ↩︎

  2. 0-9. ↩︎

posted @ 2022-11-06 15:44  哩个啷个波  阅读(1218)  评论(0)    收藏  举报