Thanks! What you said works, but I was trying to avoid all those individual queries (which would be equal to number of posts in this case) and generate a single query like this...
SELECT Profile.country_code, COUNT(Post.id) as `post_count` FROM Post JOIN Profile ON ( Post.user_id = Profile.user_id ) WHERE Profile.country_code IS NOT NULL GROUP BY Profile.country_code Hope it makes sense this time around :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
