mysql 一个搜索框 匹配表中多个字段

select * from table where id=1 and uid=2 and (status=2 or status=3 or status=4);

以下个人使用案例:多个字段,查询条件 格力

SELECT
a.sid,
a.spid,
a.sname,
a.spic,
a.sprice,
a.smarket,
a.ssn,
a.samount,
a.stime,
a.smarktime,
a.creationtime,
a.sinfo,
a.productmoney,
a.membermoney,
a.company,
a.specifications,
a.supplyStoreName,
c.bname AS sbrand,
b.NAME AS typeName
FROM
shop_goods a
LEFT JOIN sys_dictionary b ON a.spid = b.ID
LEFT JOIN shop_brand c ON a.sbrand = c.bid
WHERE
1 = 1
AND (a.sname LIKE CONCAT( CONCAT( ‘%‘, ‘格力‘ ), ‘%‘ ) or a.ssn =‘格力‘ or b.NAME =‘格力‘ or c.bname = ‘格力‘ )
mysql 一个搜索框 匹配表中多个字段

mysql 一个搜索框 匹配表中多个字段

mysql 一个搜索框 匹配表中多个字段

上一篇:查询数据库死锁


下一篇:学习:inets