this is my expression engine query
$query = $this->EE->db->query("SELECT * FROM exp_categories WHERE parent_id=$parent_id order by cat_id ASC"); and $parent id = 4|7 (for category parent id passed from template by user)
now query should return result for both parent id's