I have a simple MySQL statement that keeps showing an error.
type is an column in table ps_product_custom_statistics_weekly and i would like to select only the value from type where it has an value of all.
SELECT `cat`.`brand_name`
FROM `ps_product_brand` AS `cat`
INNER JOIN `ps_product_custom_statistics_weekly` AS `cat_p`
ON `cat_p`.`id_product` = `cat`.`id_product`
WHERE `cat_p`.`type` LIKE `%all%`
AND `cat_p`.`rank` <= 16;
Error msg :
#1054 - Unknown column '%all%' in 'where clause'
(i dont understand why it tells me this, im using cat_p.type to select column and LIKE %all% to get string from that column, please help)
Table:
ps_product_custom_statistics_weekly
product_id type rank
+-------------+--------------+------------------+
| 1 | weekly | 20 |
+-------------+--------------+------------------+
| 2 | all | 10 |
+-------------+--------------+------------------+
Thanks