รวม person กับ person มีปัญหา
DateTime : 2010-12-30 15:09:46
Post By : admin_tranform
IP Address : 182.52.30.162
รวม person กับ person มีปัญหาค่ะ
พอรวมแล้ว ส่งออก18แฟ้ม กลับส่งออก pid ตัวเก่าออกมาด้วย ซึ่งpid ตัวเก่าcid เป็น111111111111 เลย errorค่ะ
Message !!
หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..
กระทู้ตอบกลับ
ลองตรวจสอบดูว่ามีชื้อสกุลซ้ำกันอีกหรือไม่ครับ
Post โดย : chinaga Date: 2010-12-31 09:21:35 ip: 113.53.239.85
select h.village_id,h.address,vl.village_moo,p.* ,pc.name as pttype_name,x.name as sex_name ,
n.name as nationality_name, concat(p2.fname,' ',p2.lname) as father_name ,
concat(p3.fname,' ',p3.lname) as mother_name , concat(p4.fname,' ',p4.lname) as couple_name ,
e.name as education_name ,o.name as occupation_name,r.name as religion_name ,
y.name as marrystatus_name ,t.house_regist_type_name , f.family_no , pp.person_house_position_name
from person p
left outer join house h on h.house_id = p.house_id
left outer join village vl on vl.village_id = h.village_id
left outer join pttype pc on pc.pttype = p.pttype
left outer join sex x on x.code = p.sex
left outer join nationality n on n.nationality = p.nationality
left outer join education e on e.education = p.education
left outer join occupation o on o.occupation = p.occupation
left outer join religion r on r.religion = p.religion
left outer join marrystatus y on y.code = p.marrystatus
left outer join person p2 on p2.person_id = p.father_person_id
left outer join person p3 on p3.person_id = p.mother_person_id
left outer join person p4 on p4.person_id = p.couple_person_id
left outer join person_house_position pp on pp.person_house_position_id = p.person_house_position_id
left outer join family f on f.family_id = p.family_id
left outer join house_regist_type t on t.house_regist_type_id = p.house_regist_type_id
where p.death = 'N' and p.house_id not in (2529) and p.patient_hn is null
order by round(h.address),p.person_id
Post โดย : wauy Date: 2010-12-31 13:38:38 ip: 119.42.116.128
ของผมก็เป็นนะ ถ้ารวมperson โดยไปที่ tool รวมpersonที่ผิด มันไม่รวม 100% ครับ ต้องมาใช้ sql รวมเองด้วยครับ
Post โดย : dogmike Date: 2011-01-01 12:05:07 ip: 203.113.118.78
ใช้ sql รวมยังไงครับ
ท่านดอกไม้
Post โดย : wauy Date: 2011-01-03 08:56:10 ip: 122.154.140.34
dogmike ไม่ใช่ดอกไม้นะครับ ...
Post โดย : dogmike Date: 2011-01-06 09:03:46 ip: 203.113.118.78