ตัวอย่าง...เบื้องต้น..ครับ..
select p.hn,d.an,concat(p.pname,p.fname,"",p.lname) as pat,d.death_diag_1 ,d.death_date from patient p
left outer join death d on d.hn=p.hn
where d.death_diag_1 between "A00" and "S999"
and death_date between" 2010-06-01" and "2012-06-30"
group by d.hn
order by death_date