一、MySql
1.单引号嵌双引号
select CONCAT("'%",'"',"dengji",'"',"%'") from dual;结果输出:'%"dengji"%' 这里的%只是做模糊查询用没有其它含义
2.双引号嵌单引号
select CONCAT('"%',"'","b","'",'%"') from dual;结果输出:"%'b'%"这里的%只是做模糊查询用没有其它含义
3.如上拼接实际运用于mybatis
<select id="getSupplementInfo" resultType="cn.tongdun.model.entity.supplement.SupplementDO"> select id,typeName,jsonStr,create_time as createTime,modify_time as modifyTime from river_supplement_info where 1=1 <if test="typeName != null">and typeName=#{typeName}</if> <if test="key != null and searchField!=null">and jsonStr like CONCAT('%','"',#{searchField},'"',":",'"',#{key},'"','%')</if> order by create_time DESC </select>
二、Oracle
待补充
标签:jsonStr,复杂,time,typeName,拼接,CONCAT,SQL,select From: https://www.cnblogs.com/xiaohu666/p/17145536.html