SELECT "cats".* FROM "cats" INNER JOIN dogs d on d.cat_id = cats.id;