mysql - 搜索(帽子)等产品。但我在 mysql 的产品表中有带有 (hat) 的产品名称。我想要与帽子或帽子类似的结果
问题描述
我有三个表,我正在使用内部联接从这些表中获取数据。
SELECT u.user_id, u.user_full_name, u.user_picture,
s.shop_id, s.user_id, s.shop_name,
p.product_id, p.product_name, p.product_description,
p.product_image, p.product_price, p.user_id
FROM products AS p
INNER JOIN shops AS s
ON p.user_id = s.user_id
INNER JOIN users AS u
ON s.user_id = u.user_id
//this function is used to add two or more strings
WHERE lower(p.product_name)
LIKE '%hats%'
GROUP BY s.user_id
/* query end*/
解决方案
推荐阅读
- python - mysql连接是否有某种冷却保护
- javascript - 模块关闭(ACF)后如何停止播放视频?
- php - Liskov 替代原则与多态性
- java - 我可以使用 android:onClick 按钮属性调用方法名称“onClick”或“onclick”吗?
- javascript - 如何为nodeJs express应用添加firebase事件监听器
- python - 使用 Selenium 作品登录页面 - 使用 BS4 作品解析 - 但不是两者的结合
- python - 如何删除子图?
- php - 在数据库中发送响应时的贝宝集成错误
- javascript - 用 Javascript 发送带有附件的电子邮件
- r - 优化工作脚本速度所需的 for-loop 替代方案