BMS-HOSxP Community
HOSxP => รายงานตัวชี้วัด 66 ตัวของกระทรวงสาธารณสุข => ข้อความที่เริ่มโดย: manoi ที่ เมษายน 03, 2013, 14:41:06 PM
-
ที่มา ระบบบันทึกข้อมูลภาวะโภชนาการ บัญชี 2/3
ข้อมูล A จำนวนเด็กส่วนสูงระดับดีและรูปร่างสมส่วน
select count(distinct person_id) from person where person_id in
(
select distinct p1.person_id
from person p1,person_wbc p2,person_wbc_nutrition p3
where p1.person_id = p2.person_id
and p2.person_wbc_id = p3.person_wbc_id
and p3.bmi_level = 3
and p3.height_level >= 3
and p1.in_region = 'Y'
and p1.birthdate between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
union
select distinct p1.person_id
from person p1,person_epi p2,person_epi_nutrition p3
where p1.person_id = p2.person_id
and p2.person_epi_id = p3.person_epi_id
and p3.bmi_level = 3
and p3.height_level >= 3
and p1.in_region = 'Y'
and p1.birthdate between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
)
ข้อมูล B จำนวนเด็กที่ชั่งน้ำหนักและวัดส่วนสูงทั้งหมด
select count(distinct person_id) from person where person_id in
(
select distinct p1.person_id
from person p1,person_wbc p2,person_wbc_nutrition p3
where p1.person_id = p2.person_id
and p2.person_wbc_id = p3.person_wbc_id
and p1.in_region = 'Y'
and p1.birthdate between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
union
select distinct p1.person_id
from person p1,person_epi p2,person_epi_nutrition p3
where p1.person_id = p2.person_id
and p2.person_epi_id = p3.person_epi_id
and p1.in_region = 'Y'
and p1.birthdate between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
)
-
ขอเป็นแบบรายงานได้ไหมครับขอบคุณครับ
-
queryแล้วไม่ได้ครับ
-
ขอแบบมีรายชื่อด้วยได้ไหมครับ ขอบคุณครับ
-
ขอบคุณมาก ๆ ครับ ตรงใจจิง ๆ ;D
-
ขอเป็นแบบรายงานได้มั้ยค่ะ
-
queryแล้วไม่ได้ครับ
รันได้ครับ ได้ใส่ช่วงวันที่ ใน '2013-10-01' and '2014-04-30' ที่ต้องการหรือยังครับ