kendine göre düzenlersin

SELECT g.*,c.* FROM firmalar g,altkat c WHERE g.katid = c.aktid GROUP BY c.id ORDER BY id DESC