โปรแกรมบัญชีเกณพ์คงค้าง รพ.สต. สสจ.สุรินทร์ รายงานผู้บริหารด้านการเงิน รพ.สต.

รบกวนพี่หน่อยค่ะ


DateTime : 2010-11-25 16:55:30
Post By : nongone
IP Address : 203.113.116.117

คือว่าหนู อยากได้รายงานแบบนี้  ต้องใช้คำสั่งแบบไหนค่ะ 

รายการ   รายหมู่ รวม ร้อยละ
ม.1 ม.2 ม.3 ม.4 ม.5 ม.6 ม.7 ม.8    
แบบสรุปบัญชี 1-8 ข้อมูลประชากร คน                    
ต่ำกว่า1 ปี - ชาย คน                    
.             - หญิง คน                    
2-4 ปี       - ชาย คน                    
.             - หญิง คน                    
5-6 ปี       - ชาย คน                    
.             - หญิง                      


Message !!

หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..


กระทู้ตอบกลับ

ร้อยล่ะ คือ

ประชากรทั้งหมด(ม.1-ม.8)                  = 100

ด้วย จำนวนอายุ 1-4 ปี รวมกัน

ขอบคุณน่ะค่ะ


Post โดย :  nongone Date: 2010-11-25 17:18:15 ip: 203.113.116.117

ลองเอาไปใช้ดูนะ น้องวัน

select "สรุปจำนวนประชากรแยกตามหมู่",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id
union
select "เด็กอายุต่ำกว่า1ปี ชาย",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y<2  and sex=1
union
select "เด็กอายุต่ำกว่า1ปี หญิง",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y<2  and sex=2
union
select "เด็กอาย2-4ปี ชาย",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y between 2 and 4  and sex=1
union
select "เด็กอายุ2-4ปี หญิง",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y between 2 and 4  and sex=2
union
select "เด็กอายุ5-6ปี ชาย",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y between 5 and 6  and sex=1
union
select "เด็กอายุ5-6ปี หญิง",
count( if(vl.village_moo in("1","01","001") ,"1",null )) as "P_Moo1" ,
count( if(vl.village_moo in("2","02","002") ,"1",null )) as "P_Moo2" ,
count( if(vl.village_moo in("3","03","003") ,"1",null )) as "P_Moo3" ,
count( if(vl.village_moo in("4","04","004") ,"1",null )) as "P_Moo4" ,
count( if(vl.village_moo in("5","05","005") ,"1",null )) as "P_Moo5" ,
count( if(vl.village_moo in("6","06","006") ,"1",null )) as "P_Moo6" ,
count( if(vl.village_moo in("7","07","007") ,"1",null )) as "P_Moo7" ,
count( if(vl.village_moo in("8","08","008") ,"1",null )) as "P_Moo8" ,
count( vl.village_moo) as P_all
from person  ps
left outer join village vl on vl.village_id =ps.village_id  and ps.age_y between 5 and 6  and sex=2


Post โดย :  dogmike Date: 2010-11-25 18:53:05 ip: 203.113.118.74

ผลลัพเป็นงัย ก็รายงานผลด้วยนะครับ


Post โดย :  dogmike Date: 2010-11-25 23:43:38 ip: 203.113.118.78

ทำมัยมันยาวจัง


Post โดย :  admin_tranform Date: 2010-11-26 08:48:12 ip: 125.26.114.106

ขอบคุณมากเลยค่ะ พี่ดอกไม้ หน้าตาดีแถบยังเก่งด้วย ขอบคุณมากๆๆๆน่ะค่ะ 


Post โดย :  nongone Date: 2010-11-26 09:52:49 ip: 203.113.116.117

ขอบคุณมากนะน้องวัน แต่ dogmike ไม่ใช่ดอกไม้นะครับ  

แล้วผลลัพล่ะออกหรือป่าว เพราะว่าเขียนแล้วยังไม่ได้ลองเหมือนกัน   555555 


Post โดย :  dogmike Date: 2010-11-26 11:23:22 ip: 203.113.118.74

doctor dent


Post โดย :  nongone Date: 2010-11-26 20:22:26 ip: 203.113.116.117

ขอโทษน่ะคร่วางผิดที่  ขอโทษจริงค่ะ   พอดีพิมพ์งานอยู่


Post โดย :  nongone Date: 2010-11-26 20:23:27 ip: 203.113.116.117

อืมม์ เยี่ยมเลย แต่ก็ยังออกมาไม่หมด

เพราะยังไม่ได้คีย์ข้อมูล ฮ่า ๆๆๆ.

สงสัยต้อง รบกวน นายดอกไม้ บ่อย ๆ แล้วละ..


Post โดย :  สบู่เหลว Date: 2010-11-27 15:10:23 ip: 113.53.248.66