如何在where子句
中检查这个这应该返回false '千' ='美国'
这应该返回false '加拿大''塔' ='加拿大'
这应该返回true '南非,'非洲' ='南非'
答案 0 :(得分:0)
Oracle安装程序:
CREATE TABLE your_table ( strname ) AS
SELECT '''canada'',''tower''' FROM DUAL UNION ALL
SELECT '''south'',''africa''' FROM DUAL;
<强>查询强>:
SELECT *
FROM your_table
WHERE strname LIKE '%''' || lower( 'canada' ) || '''%'
<强>输出强>:
STRNAME
----------------
'canada','tower'
<强>查询强>:
SELECT *
FROM your_table
WHERE strname LIKE '%''' || lower( 'south' ) || '''%'
AND strname LIKE '%''' || lower( 'africa' ) || '''%'
<强>输出强>:
STRNAME
----------------
'south','africa'