AliChemicali
Legacy Member
Hallo ik ben opzoek hoe ik lijntje kan krijgen tussen mijn result en totaal zoals afgebeeld op de volgende afbeelding. Een enter zou ook al goed zijn maar een lijntje is beter.
En hier is mijn code:
En hier is mijn code:
Code:
--Ga per instelling na hoeveel patiënten er in de vakantiemaanden juli en augustus in het ziekenhuis of thuis bleven slapen.
select instelling.result0 Instelling, ziekenhuis.result1 Ziekenhuis,thuis.result1 Thuis from
(select p.IDMI result0 from imp_patient p group by p.IDMI) instelling
,
(select p.IDMI result0, count(*) result1 from imp_patient p,feit_ligdag f, dim_kalender k, dim_locatie l
where f.patient_id = p.id and f.kalender_id = k.kalender_id and k.maand_nr in (7,8) and f.locatie_id = l.locatie_id and l.code = 0
group by p.IDMI) ziekenhuis
,
(select p.IDMI result0, count(*) result1 from imp_patient p,feit_ligdag f, dim_kalender k, dim_locatie l
where f.patient_id = p.id and f.kalender_id = k.kalender_id and k.maand_nr in (7,8) and f.locatie_id = l.locatie_id and l.code = 1
group by p.IDMI) thuis
where instelling.result0 = ziekenhuis.result0
and ziekenhuis.result0 = thuis.result0
union all
select 'Totaal',ziekenhuis.result1,thuis.result1 from
(select count(*) result1 from imp_patient p,feit_ligdag f, dim_kalender k, dim_locatie l
where f.patient_id = p.id and f.kalender_id = k.kalender_id and k.maand_nr in (7,8) and f.locatie_id = l.locatie_id and l.code = 0
) ziekenhuis
,
(select count(*) result1 from imp_patient p,feit_ligdag f, dim_kalender k, dim_locatie l
where f.patient_id = p.id and f.kalender_id = k.kalender_id and k.maand_nr in (7,8) and f.locatie_id = l.locatie_id and l.code = 1
) thuis

