數據庫拼接字符模糊查詢語句(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