How to select single quote mark exist records using oracle regex

前端 未结 2 1942
别跟我提以往
别跟我提以往 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: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, '''+')
    

提交回复
热议问题