数据库拼接字符模糊查询语句(mybatis中运用(xml文件))


   concat:数据库中拼接字符串方法

 distinct :消除重复行

group by:分组排序

方法1;

select distinct function_name,function_module,function_url,date
from agent_function
where
concat('',function_name,function_module) like CONCAT('%',#{_parameter}, '%')

 

方法2;

select distinct function_name,function_module,function_url,date
from agent_function
where function_name LIKE CONCAT(CONCAT('%', #{_parameter}), '%') or
function_module LIKE CONCAT(CONCAT('%', #{_parameter}), '%')


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM