VAŠ EKSPERT ZA KUHINJU

BLANCO - SLAVINE

Zatvori
SELECT * FROM (SELECT *,1 as ascase FROM `artikli` WHERE `id`!='0' AND `novo`!='on' AND `aktivan`='on' AND `prikaz_b2c`='on' AND `mpcena`!='0.00' AND category_id IN (-100012) AND (`filter` LIKE "%a7913a%" AND category_id IN (-100012) ) AND parent_id IS NULL UNION SELECT *,1 as ascase FROM `artikli` WHERE `id`!='0' AND `novo`!='on' AND `aktivan`='on' AND `prikaz_b2c`='on' AND `mpcena`!='0.00' AND category_id IN (-100012) AND (`filter` LIKE "%a7913a%" AND category_id IN (-100012) ) AND parent_id IS NULL AND vodi_se_zaliha='' UNION SELECT a2.*,1 as ascase FROM artikli a INNER JOIN artikli a2 ON a2.id = a.parent_id WHERE a2.novo!='on' AND a.aktivan = 'on' AND a.`prikaz_b2c`='on' AND a.parent_id IS NOT NULL AND a.`mpcena`!='0.00' AND a.category_id IN (-100012) AND (a.`filter` LIKE "%a7913a%" ) GROUP BY a.parent_id ORDER BY ascase ASC, `id` DESC) t1