While I don't know the specifics of your project, I can confirm that I have done this several times. Like for example on my blog categories page -- I have a repeat region to display the various categories that are entered to accompany each blog. Within that repeat region, though, is another one that goes through all the posts again to provide a count for how many times the category is mentioned. So the first query just loops through using the MySQL UNIQUE command to get each cat once.. the nested loop then counts how many posts match the category in order to provide an accurate category and tag list. To see the page I am referring to, see here: blog.php
Let me know if you want any code snippets.