Samma metodik, skapa en hjälptabell (ht) som innehåller två kolumner, den första som innehåller undre gränsen och en för den övre gränsen för ditt löneinterval.
select low,high,
sum(case when grupp.grupp = '1' and grupp.lön is not null then 1 else 0 end),
sum(case when grupp.grupp = '2' and grupp.lön is not null then 1 else 0 end),
sum(case when grupp.grupp = 'R' and grupp.lön is not null then 1 else 0 end)
from ht left join grupp on grupp.lön between ht.low and ht.high
group by low,high