I want to build a portfolio page using isotope , and this jquery plugin has a feature of filtering.I added this jquery plugin to wordpress, and want to filter the images using the post tags.We can’t use all the tags, because it will be huge if you have many posts. So we can add portfolio posts to one or several categories, then we use query the tags on these categories, and this will be a effective way.The sql statement is a working one to query tags on one category:

And $args is the category name.If you want to query tags on multiple categories, then using the sql statement below:

The only different is we use term_id not name, and you can construct a args like this:
1 | $args = array( ‘categories’=> ‘12,13,14’); |
The id is your id of category.