/* -- script แก้ person เรื่องอาชีพ การศึกษา และ ศาสนา ทั้งนี้กรุณา backup ข้อมูลไว้ก่อนเสมอ และควรตรวจสอบความถูกต้องด้วย -- ขั้นตอนการใช้ -- เปิดโปรแกรม Hosxp ไปที่สายฟ้า -- copy คำสั่งล่างนีไปวางในช่องใต้ query แล้วกด run จบ -- --------------------------------------------คำสั่ง----------------------- */ update occupation set nhso_code='9999' where occupation='000'; update occupation set nhso_code='6111' where occupation='001'; update occupation set nhso_code='9622' where occupation='002'; update occupation set nhso_code='5221' where occupation='003'; update occupation set nhso_code='9629' where occupation='004'; update occupation set nhso_code='1210' where occupation='005'; update occupation set nhso_code='1111' where occupation='006'; update occupation set nhso_code='5412' where occupation='007'; update occupation set nhso_code='6222' where occupation='008'; update occupation set nhso_code='1345' where occupation='009'; update occupation set nhso_code='9629' where occupation='010'; update occupation set nhso_code='6121' where occupation='012'; update occupation set nhso_code='2636' where occupation='013'; update occupation set nhso_code='9001' where occupation='014'; update occupation set nhso_code='9000' where occupation='015'; update occupation set nhso_code='9629' where occupation='900'; update occupation set nhso_code='9629' where occupation='901'; update occupation set nhso_code='9002' where occupation='902'; update occupation set nhso_code='6111' where occupation='501'; update occupation set nhso_code='6111' where occupation='502'; update occupation set nhso_code='6222' where occupation='507'; update occupation set nhso_code='6224' where occupation='508'; update occupation set nhso_code='5162' where occupation='714'; update occupation set nhso_code='9129' where occupation='715'; update occupation set nhso_code='9121' where occupation='716'; update occupation set nhso_code='5141' where occupation='717'; update occupation set nhso_code='5142' where occupation='718'; update occupation set nhso_code='9622' where occupation='403'; update occupation set nhso_code='1113' where occupation='211'; update occupation set nhso_code='1113' where occupation='213'; update occupation set nhso_code='2211' where occupation='106'; update occupation set nhso_code='2212' where occupation='107'; update occupation set nhso_code='2261' where occupation='108'; update religion set nhso_code=concat('0',trim(nhso_code)) where LENGTH(nhso_code)=1; update person set religion='01' where religion=0; update person set religion='01' where religion=1; update person set religion=concat('0',trim(religion)) where LENGTH(religion)=1; update person set religion='09' where religion='' or religion is null; update person set education='9' where education='' or education is null; update person set house_regist_type_id='4' where house_regist_type_id='' or house_regist_type_id is null;