postgresql中字符串的数字形式查询

在数据库执行sql查询时,需要在where部分限制执行范围为某字段为数字字符串形式。在使用LIKE语句时遇到了困难。LIKE只支持%和_两种通配符(前者为不限长度的字符串,后者为单个字符)。

其解决方案是使用~函数符号,这是支持正则形式的like功能代替。

因此解决方案就是:

select * from my_table where my_field ~ '^[0-9]+?$'

这样其含义就是查找所有纯数字形式的字符串。


已发布

分类

来自

标签:

评论

《 “postgresql中字符串的数字形式查询” 》 有 13 条评论

  1. order androxal generic tablets

    buy androxal generic uae

  2. ordering enclomiphene generic india

    how to order enclomiphene buy online australia

  3. how to order rifaximin online mastercard accepted

    buy rifaximin cost uk

  4. online order xifaxan non prescription online

    buy cheap xifaxan generic switzerland

  5. how to order staxyn cheap pharmacy

    order staxyn uk suppliers

  6. best price for generic avodart

    cheapest buy avodart lowest price viagra

  7. purchase dutasteride generic side effect

    how to buy dutasteride usa online pharmacy

  8. discount flexeril cyclobenzaprine cost of tablet

    flexeril cyclobenzaprine no rx saturday delivery

  9. discount gabapentin price singapore

    cheapest buy gabapentin price south africa

  10. generique kamagra pharmacie au rabais vallee d aoste

    comprar kamagra sin receta medica

  11. where to purchase fildena online

    online order fildena canada low cost

  12. compare itraconazole prices

    online order itraconazole australia to buy

  13. kamagra nテ。kup on-line ナセテ。dnテス pナ册dpis rychlテゥ dodテ。nテュ

    koupit kamagra online nejlevnト嬲ナ。テュ

回复 Buy avodart online without a perscription 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注