SQL“多字段模糊匹配关键字查询”

情景1:同一个表里的多个字段

SELECT * FROM orders o where concat(o.email,o.address) like "%关键字%"

情景2:不同表里的多个字段

SELECT * FROM line_items l,orders o where l.order_id=o.id and 
concat(l.quantity,o.email) like "%关键字%"

猜你喜欢

转载自blog.csdn.net/hacker_Lees/article/details/80063476
今日推荐