Page 1 of 3
DENTAL
/*คำสั่งเรียก 06.เจ้าพนักงานทันตสาธารณสุข ที่บันทึก provider ถูกต้อง */
set @provider = '06'; SELECT doctor.`code`,doctor.pname,doctor.fname,doctor.lname,doctor.cid, doctor.provider_type_code,pvt.provider_type_name,doctor.sex, doctor.birth_date,doctor.start_date,doctor.finish_date,doctor.active FROM doctor LEFT JOIN provider_type as pvt on pvt.provider_type_code = doctor.provider_type_code WHERE doctor.provider_type_code =@provider and doctor.pname is not null and doctor.fname is not null and doctor.lname is not null and length(cid)=13 and doctor.sex in ('1','2') and doctor.birth_date < curdate() and doctor.start_date is not null #----------------------- |
ตัวอย่าง
code | pname | fname | lname | cid | provider_type_code | sex | birth_date | start_date | finish_date |
9 | น.ส. | ศรินยา | xxx | 8888888888888 | 06 | 2 | 9/12/1977 | 1/4/1998 | null |
47 | น.ส. | สุพรรษา | xxx | 8888888888888 | 07 | 2 | 6/12/1980 | 2/4/2001 | null |
56 | น.ส. | สมปอง | xxx | 8888888888888 | 08 | 2 | 7/5/1963 | 16/10/1984 | null |
57 | นาย | ประสิทธิ์ | xxx | 8888888888888 | 09 | 1 | 8/1/1957 | 1/10/2009 | 1/10/2009 |
- ก่อนหน้า
- ต่อไป >>