select count(tipo) as n, tipo from notificaciones where id_usuarios={id} and vista=2 group by tipo