Regular Expressions _# at end of string

后端 未结 2 511
梦谈多话
梦谈多话 2021-01-16 11:38

I am using the REGEXP_LIKE function in Oracle 10g to find values in a column with a suffix of _#(like _1, _2 etc). I can find _# in any part of the value with the query belo

相关标签:
2条回答
  • 2021-01-16 12:21

    Sure. Use...

    SELECT * FROM Table WHERE  REGEXP_LIKE (COLUMN,'_[[:digit:]]$')
    

    The $ character matches "the end of the string."

    0 讨论(0)
  • 2021-01-16 12:27

    No need to use reg exps.

    select * from table where substr(column,-2) between '_0' and '_9';
    
    0 讨论(0)
提交回复
热议问题