BMS-HOSxP Community
HOSxP => การเขียน SQL Script => ข้อความที่เริ่มโดย: gu_prajag ที่ พฤษภาคม 02, 2008, 11:58:50 AM
-
อยากได้รายชื่อผู้ป่วยเบาหวาน ที่ complete lab ในช่วงวันที่กำหนด
ใครมี sql หรือรายบ้าง ครับ ในหน้าห้อง lab มันจะมีแต่มันรวมทั้งหมดและก็ออก exel ไม่ได้
-
select l1.*, p.pname,p.fname,p.lname
from lab_head l1
left outer join patient p on p.hn = l1.hn
where l1.hn in (select hn from clinicmember where clinic = '001') and l1.form_name = 'Complete Lab' and l1.order_date between 'yyyy-mm-dd' and 'yyyy-mm-dd'
-
ขอบคุณ ครับ