- SELECT `product`.`id`, `product`.`name`, `product`.`condition`, `product`.`city_id`, `product`.`price`,`user`.`name` AS `user_name`, `city`.`name` AS `city_name`
- FROM `product_to_category` `p2c`
- JOIN `product` `product` ON product.id = p2c.product_id
- LEFT JOIN `city` `city` ON city.id=product.city_id
- LEFT JOIN `user` ON user.id=product.user_id
- WHERE (
- ((`product`.`id` in (
- select product_id from product_to_city
- join city on (city.id = product_to_city.city_id)
- where city.id = 1 or city.parent_id = 1
- ))) AND
- ( (`product`.`zombie` = 0)) AND (`product`.`publish` = 1 AND (`product`.`delete` = 0 OR `product`.`delete` is null)))
- GROUP BY `product`.`id`
- HAVING COUNT(1) > 1
- ORDER BY `product`.`timestamp_update` DESC