WHERE query like this:
P.S this query is not working as intended
select *, ( SELECT `created_at` FROM `promotions` WHERE `promotions`.`position` = 'brands__' + `brands`.`id`
ORDER BY `created_at` DESC LIMIT 1 ) as `promoted_date` from `brands` order by `promoted_date` desc limit 10 offset 0
this part:
WHERE `promotions`.`position` = 'brands__' + `brands`.`id`
instead of doing what it's suppose to do as intended it's selecting
WHERE `promotions`.`position` LIKES 'brands__%'
any idea how to fix this ?
How do you know it's doing % instead of id?
Обсуждают сегодня