ประมาณนี้ไหมครับ ตอบให้ 2 กระทู้นะครับ
select count(DISTINCT ov.hn) as kon,SUM(ov.admdate) as wunnon,SUM(ov.income) as price
from an_stat ov ,patient pt ,ipt ovst
where ov.an=ovst.an and ov.dchdate between "2014-01-01" and "2014-01-31" and ov.hn=pt.hn
and ov.age_y>= 0
and ov.age_y<= 200
and ov.count_in_year=0