หรือตรวจสอบข้อมูลที่ได้จากคำสั่งนี้ครับ (เป็นคำสั่งที่ดึงข้อมูลมาส่งออก)
select pw.*, w.export_code,
op.icode,op.qty,di.did,ovs.seq_id, ov.hn as ovst_hn,
a.*,p.person_id,p.cid,concat(p.pname,p.fname,'' '',p.lname) as ptname ,p.age_y , h.address,h.road,v.village_moo,v.village_name,
t.full_name as full_address_name , m.name as marrystatus_name,w.women_birth_control_name
from person_women_service pw
left outer join ovst_seq ovs on ovs.vn = pw.vn
left outer join ovst ov on ov.vn = pw.vn
left outer join opitemrece op on op.vn = pw.vn
left outer join drugitems di on di.icode = op.icode
left outer join person_women a on a.person_women_id = pw.person_women_id
left outer join person p on p.person_id = a.person_id
left outer join house h on h.house_id = p.house_id
left outer join village v on v.village_id = h.village_id
left outer join thaiaddress t on t.addressid = v.address_id
left outer join marrystatus m on m.code = p.marrystatus
left outer join women_birth_control w on w.women_birth_control_id = a.women_birth_control_id
where pw.service_date between '2010-07-01' and '2010-07-31'
and pw.women_service_id = 1