-3
的我怎么在单引号串联级联查询
SELECT abc,
abcd
FROM table
WHERE abc IN (SELECT efg
FROM table2
WHERE gfh LIKE'%a%')
。在查询结束时连接',% and)
时遇到问题。
的我怎么在单引号串联级联查询
SELECT abc,
abcd
FROM table
WHERE abc IN (SELECT efg
FROM table2
WHERE gfh LIKE'%a%')
。在查询结束时连接',% and)
时遇到问题。
最好的方法是使用引用字符串文字技术。语法是q'[...]'
,其中“[”和“]”字符可以是以下任何字符,只要它们没有出现在字符串中即可。
测试用例
SQL> SELECT
2 q'[select abc, abcd
3 from table
4 where abc in
5 (select efg
6 from table2
7 where gfh like '%a%')]' str_concat
8 FROM dual
9/
STR_CONCAT
-----------------------------------------------
select abc, abcd
from table
where abc in
(select efg
from table2
where gfh like '%a%')
SQL>
任何反馈到应答? – 2014-11-03 05:21:20