如何在Oracle11g中搜索单引号
当我使用如下查询时,如何从表中搜索像如何在Oracle11g中搜索单引号,oracle11g,Oracle11g,当我使用如下查询时,如何从表中搜索像O'Neil这样的名称 select * from table_name where name like 'O'Neil'; 然后显示一个错误。用第二个单引号将其转义: select * from table_name where name like 'O''Neil'; 自Oracle 10g以来,还有一个报价运营商: select * from table_name where name like q'('O'Neil)'; 语法:q'c要引用的文本
O'Neil
这样的名称
select * from table_name where name like 'O'Neil';
然后显示一个错误。用第二个单引号将其转义:
select * from table_name where name like 'O''Neil';
自Oracle 10g以来,还有一个报价运营商:
select * from table_name where name like q'('O'Neil)';
语法:q'c要引用的文本c'
c
是单个字符(称为引号分隔符)。对于«quote operator»,撇号不必加倍