select `institutions`.*, (selectsum(`courses`.`visitors`) from `courses` where `institutions`.`id` = `courses`.`institution_id`) as `visitors_sum` from `institutions` where `is_university` =1and `institutions`.`deleted_at` isnullorderby `visitors_sum` desc limit 36