i have 2 tables 1. Categories table 2. Sub-Categories table Just the lamest idea of categories There is one main category with about 5 subcategories each how can i do the query in one execution? currently i have this one: select t1.post_categories_name,(select t2.subcategories_name from post_subcategories as t2 where t1.post_categories_id = '1' group by t2.group) as subCategories from post_categories as t1 left join post_subcategories as t2 on t1.post_categories_id = t2.subCat_parent_id and outputting this: Array ( [0] => Array ( [post_categories_name] => Community [subCategories] => Before / After Photos ) [1] => Array ( [post_categories_name] => Community [subCategories] => Before / After Photos ) [2] => Array ( [post_categories_name] => Community [subCategories] => Before / After Photos ) [3] => Array ( [post_categories_name] => Community [subCategories] => Before / After Photos ) [4] => Array ( [post_categories_name] => Ebony Skin Secret [subCategories] => ) [5] => Array ( [post_categories_name] => Educational [subCategories] => ) [6] => Array ( [post_categories_name] => Message Board [subCategories] => ) [7] => Array ( [post_categories_name] => Referral Doctor [subCategories] => ) ) Please note that the query above, on the subquery statement theres a static value of 1. and the query musnt have a static value Please help..