SELECT c1.Id AS Id1, c2.Id AS Id2, c1.Title AS Title1, c2.Title As Title2, c1.ItemCount As ItemCount1, c2.ItemCount as ItemCount2 FROM categories AS c1 LEFT JOIN categories AS c2 ON c2.ParentId = c1.Id WHERE c1.ParentId = 0 ORDER BY Title1 ASC, Title2 ASC