select university,count(university) cnt,group_concat(device_id separator ";") device_list from
user_profile
group by university
having cnt<3

group_concat(拼接参数,order by 排序,separator 指定分隔符)