concat() 函數(shù),是用來連接字符串。
精確查詢: select * from user where name=”zhangsan” 模糊查詢; select * from user where name like “%zhang%”
在實際的使用中,條件是作為參數(shù)傳遞進來的。 所以我們使用 concat() 函數(shù)
mybatis: select * from user where name like concat(“%”, #{name},”%”) concat(str1,str2,str3,str4,……….); 連接字符串函數(shù),會生成一個字符串
新聞熱點
疑難解答