SELECT id catname thumb items_count items_org_count c2 id AS parent FR

1
2
3
4
5
6
SELECT c.id, c.catname, c.thumb, c.items_count, c.items_org_count, c2.id AS parent
FROM #__ads_categories as c
INNER JOIN #__ads_categories AS c2 on c2.parent = c.id AND c2.is_org = 1
WHERE c.parent = 0
AND c.published = 1
ORDER BY c.ordering