Fik hjælp til løsningen andensteds
select itfirma.navn,(select count(status) from <tabel> where status =
1 and itfirma.telefon = <tabel> .itfirma_telefon group by
itfirma.telefon) as status1,
(select count(status) from <tabel> where status = 2 and
itfirma.telefon = <tabel> .itfirma_telefon group by itfirma.telefon) as
status2,
(select count(status) from <tabel> where status = 3 and
itfirma.telefon = <tabel> .itfirma_telefon group by itfirma.telefon) as
status3,
sum(pris) from <tabel> ,itfirma where <tabel> .itfirma_telefon =
itfirma.telefon group by itfirma.telefon,itfirma.navn;