我想替换单引号来运行查询。
我有如下疑问
select distinct column1 from template_data_v where template_name = 'Test' and column4=:COLUMN8;
第8栏= 48'KYTRAILER
注意:我们可以将 ' 单引号替换为 '' 并运行,但这应该适用于 :COLUMN8
的所有值select distinct column1 from template_data_v where template_name = 'Test' and column4='48''KYTRAILER';// this should work for column8 not for particular value
谁能帮忙解决这个问题吗?
使用 q-quote 语法:
with test_data (c) as
(SELECT q'!Koen's coffee!' from dual)
SELECT * FROM test_Data
where c = q'!Koen's coffee!';