23 lines
685 B
Plaintext
23 lines
685 B
Plaintext
begin
|
|
SELECT count(Mcu_OrderT_OrderHeaderID) into @peserta
|
|
FROM one_etl.mgm_mcu
|
|
join one_etl.mcu_order on Mcu_OrderMgm_McuID = Mgm_McuID
|
|
where Mgm_McuID = PID ;
|
|
|
|
select
|
|
"A" as Kode,
|
|
"Gender" as Groups ,
|
|
M_SexName as Nama ,
|
|
count(Mcu_OrderT_OrderHeaderID) as total ,
|
|
Round((count(Mcu_OrderT_OrderHeaderID) / @peserta * 100 ),2) as Persen
|
|
|
|
|
|
from one_etl.mcu_order
|
|
join t_orderheader on Mcu_OrderT_OrderHeaderID = T_OrderHeaderID and T_OrderHeaderIsActive = 'Y'
|
|
left join m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
|
|
left join m_sex ON M_PatientM_SexID = M_SexID AND M_SexIsActive = 'Y'
|
|
|
|
where Mcu_OrderMgm_McuID = PID
|
|
group by M_SexID ;
|
|
|
|
end |