【问题标题】:Regular expressions in SQL?SQL中的正则表达式?
【发布时间】:2014-12-17 14:39:41
【问题描述】:

我想在 Oracle 11g SQL 中使用正则表达式来查找与其不匹配的记录。正则表达式为:

/([A-Z]{3})+([0-9])\w+/g

我想使用的 SQL 是这样的:

select
  stu_code
  ,stu_insc
from
  intuit.ins_stu
where
  stu_insc not like ('/([A-Z]{3})+([0-9])\w+/g')

显然我知道上面是不对的,所以有人知道我是怎么做的吗?我无权运行任何 PL/SQL。

【问题讨论】:

  • 你要匹配的目标字符串是什么
  • @vks 我正在尝试查找 stu_insc 与上述正则表达式不匹配的记录
  • 你试过谷歌吗? first hit

标签: sql regex oracle


【解决方案1】:

在 oracle 上,您可以尝试类似的方法

select xyz
from theTable
where not regexp_like(mycolumn,pattern)

【讨论】:

    猜你喜欢
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    • 2010-12-30
    • 1970-01-01
    • 2018-08-02
    • 1970-01-01
    相关资源
    最近更新 更多