Hi vtxyzzy and thanks for replying . But actually your code is not necessary at least for my case (and I think that we don’t really need to write custom function with JOIN and ORDER query string).
I found out today if I want to query Custom Post Type by its Custom Taxonomy I can do directly in the query string.
In my case, I will change the query string to:
$my_query = new WP_Query('post_type=product&product-category=featured&term=featured&showposts=1&orderby=rand');
or just simple as query_posts() function:
query_posts('post_type=product&product-category=featured&showposts=1&orderby=rand');
The catch is we put the Custom Taxonomy (the term ‘product-category’ above) name directly in the query string.
Again, thanks for helping.