To better explain my question, there is an example:
I have 3 posts, all of them have category "Tech".
Post A is tagged with "Google". Post B is tagged with "Facebook". Post C is tagged with "Google".
then, on Tech category page, I want to display relative tags and order them by count. so the result should be like this "Google, Facebook".
I found a way:
get all of post ids under category "Tech".
then get tags by function
but this method has two disadvantages:
it will be very slow if there is two many posts.
the count order is total post count of a tag, not count that under a category.
Is there a MySQL way can do this job?