How to select single quote mark exist records using oracle regex

前端 未结 2 1934
别跟我提以往
别跟我提以往 2021-01-24 06:00
Table Name : Student

----------------
ID | NAME | ADDRESS
----------------
1 | Mark | Queen\'s Road
2 | Ann  | Church Road
3 | Sam  | Temple Road

I need to get si

相关标签:
2条回答
  • 2021-01-24 06:39

    im not sure about oracle but in Mysql following query will work for your purpose

    select * from student where address like "%'%"
    
    0 讨论(0)
  • 2021-01-24 06:43

    You can escape a quote in Oracle by doubling it.

    So, using the regular LIKE operator:

    SELECT * 
    FROM student 
    WHERE address LIKE '%''%'
    

    With REGEXP_LIKE you'd have to perform a similar escaping:

    SELECT * 
    FROM student 
    WHERE  regexp_like (address, '''+')
    
    0 讨论(0)
提交回复
热议问题