Mysql中where子句下的concat_ws函数

在where子句中使用concat_ws(separator,str1,str2)函数

  在mybatis-plus中的sql

SELECT count(*)
        FROM `test` t
        WHERE t.`status` = 1
        and concat_ws(',',t.work_order_number,t.picking_order_number) like  concat('%4%')

原sql语句 

SELECT count(*)
        FROM `test` t
        WHERE t.`status` = 1
				and (t.work_order_number like '%4%' or t.picking_order_number like '%4%') 

你可能感兴趣的:(mysql笔记,mysql)