使用的oracle数据库,前端传值含有&符号,oracle会默认当变量处理,改如何拼接让
它当字符串处理????
如下
控制台打印的sql为
select count(*) from t_course t left join t_course_target b on t.course_code=b.course_code where 1=1 and b.section_no in ('Games&Toys',null)
想要结果
select count(*) from t_course t left join t_course_target b on t.course_code=b.course_code where 1=1 and b.section_no in ('Games'||'&'||'Toys',null) ;
实现代码
sql+=" and b.division_no in ("+divisionNo.replaceAll("&", " '||'+'&'+'||'")+")";
请问这段我该如何拼接????