首页 > 解决方案 > 搜索(帽子)等产品。但我在 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*/

标签: mysql

解决方案


推荐阅读