skatīties video
Jaunākais video no youtube.com
Invalid query: Disk full (/var/tmp/#sql_a3b_0); waiting for someone to free some space...
SELECT DISTINCT b.id, b.name, b.path, b.width, b.height, b.url, b.priority, b.body_text
FROM banner b
JOIN banner_has_category hc ON b.id=hc.banner_id
AND ( -- banner in self and child categories
(hc.with_childs=1 AND hc.category_id IN (0, 1060, 1007, 6154))
OR -- banner in only my category
(hc.with_childs=0 AND hc.category_id=6154)
)
WHERE b.status > 0
AND b.type=0
ORDER BY b.priority DESC