ผู้เขียน หัวข้อ: ขอความช่วยเหลือ อ.MN การใช้ union Re  (อ่าน 2026 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ yut

  • Sr. Member
  • ****
  • กระทู้: 498
  • Respect: 0
    • ดูรายละเอียด
ขอความช่วยเหลือ อ.MN การใช้ union Re
« เมื่อ: กรกฎาคม 02, 2008, 12:12:27 PM »
0
ส่งฟอร์มให้แล้วครับ
สสอ.จตุรพักตรพิมาน จ.ร้อยเอ็ด 45180

ออฟไลน์ yut

  • Sr. Member
  • ****
  • กระทู้: 498
  • Respect: 0
    • ดูรายละเอียด
Re: ขอความช่วยเหลือ อ.MN การใช้ union Re
« ตอบกลับ #1 เมื่อ: กรกฎาคม 02, 2008, 12:15:19 PM »
0
หัวข้อเดิมเข้าไม่ได้ครับ

Value :=GetSQLintegerData('select count(p.person_id) from person p,house h,village v,person_epi p1,person_epi_nutrition p2'+
    ' where p.house_id=h.house_id'+
    ' and h.village_id = v.village_id'+
    ' and p2.nutrition_date between "'+ds1+'" and "'+ds2+'"'+
     ' and p1.person_epi_id = p2.person_epi_id '+
    ' and p.person_id=p1.person_id'+
    ' and p2.nutrition_level in ("1","2","3","4","5")'+
    ' and p.age_y<="5"'+
    ' and p.age_m<="11"'+
    ' and p.age_d<="30"'+
    ' and p.age_y is not null'+
    ' and v.village_id not in ("0")'+
    ' and p.house_regist_type_id = "1" and "3"' +

    'union '+
' select count(p.person_id) from person p,house h,village v,person_wbc p3,person_wbc_service p4'+
      ' where p.house_id=h.house_id and h.village_id = v.village_id'+
      ' and p3.person_wbc_id=p4.person_wbc_id'+
    ' and p4.service_date between "'+ds1+'" and "'+ds2+'"'+
      ' and p.person_id=p3.person_id'+
      ' and p4.nutrition_level in ("1","2","3","4","5")'+
      ' and p.age_y<="5"'+
      ' and p.age_m<="11"'+
      ' and p.age_d<="30"'+
      ' and p.age_y is not null'+
      ' and p.house_regist_type_id in ("1","3")' +
    ' and v.village_id = "'+DBPipeline['village_id']+'" ');
สสอ.จตุรพักตรพิมาน จ.ร้อยเอ็ด 45180