BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: panus_t ที่ ธันวาคม 13, 2012, 11:23:28 AM
-
ขอคำสั่ง Select วันที่ในตาราง1 และต้องไม่มีวันที่ดังกล่าวในตาราง2
เช่น where e.vstdate between "2011-10-01" and "2012-09-30" ต้องการหาข้อมูลปีงบ 2555
ดึงวันที่จาก er_regist.vstdate แต่วันที่ที่ดึงมาต้องไม่ซ้ำกับ holiday.holiday_date ครับ
;D
-
ได้แล้ว แบบนี้ถูกต้องหรือเปล่าครับ
select e.vn,e.vstdate,h.holiday_date,h.day_name
from er_regist e
left outer join holiday h on h.holiday_date=e.vstdate
where e.vstdate between "2011-10-01" and "2012-09-30" and er_pt_type="3" and e.vstdate not in (select holiday_date from holiday)
;D