แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Shikaru

หน้า: [1]
1
ยกเลิกใบเสร็จทีมีการเก็บลูกหนี้สิทธิ แล้วเงินกลับมาไม่ครบ กด ปรับปรุงรายการ เงินก็ไม่ยอมออก ทั้งที่ยกเลิกทุกใบเสร็จแล้ว ทั้งลูกหนี้หรือใบเสร็จ

2

Query ออกมา ผลลัพธ์ที่ได้ ก็ ok ครับ แต่ช้าเว่อๆเลย อยากทำให้มันเร็วกว่านี้ พอจะปรับตรงได้ได้มั่งครับ

อันนี้เตียงพิเศษ
select  w.snap_date,count(w.an) as cc,weekday(w.snap_date)+1
from ward_admit_snapshot w
left outer join ipt_food_menu ifm on ifm.an = w.an
 where w.snap_date between "2013-01-01" and "2013-01-01"
 and w.ward <> "03"
 and w.an = (select d.an from iptadm d where d.an = w.an and (d.bedtype = "01" or d.bedno is null or d.bedno = " ") limit 1)
 and ifm.date_id = (weekday(w.snap_date)+1)
 group by w.snap_date

เตียง สามัญ
select  w.snap_date,count(w.an) as cc,weekday(w.snap_date)+1

from ward_admit_snapshot w
left outer join ipt_food_menu ifm on ifm.an = w.an
 where w.snap_date between "2013-01-01" and "2013-01-01"
 and w.ward not in ("08","09","16","20","21","22","03")
 and w.an = (select d.an from iptadm d where d.an = w.an and (d.bedtype in ("00","02","03") or d.bedno is null or d.bedno = " ") limit 1)
 and ifm.date_id = 2
 group by w.snap_date

หน้า: [1]