SELECT catalog.catid FROM catalog INNER JOIN catalog catalog2 ON (catalog2.catid = catalog.company) WHERE catalog.category = 0 AND catalog.selected = 0 AND catalog.company=13316 GROUP BY catalog.catid

Nima