另附上SOL语言:
select b.deptid,b.deptname,a.billname,c.chrgname,c.amt
from ivc_bus_computerinv a , medical_treatment b, ivc_bus_computerinvitem c
where substr(a.deptcode,1,13)=substr(b.deptid,1,13) and c.fthrid=a.id and c.amt>0
group by b.deptid,b.deptname,a.billname,c.chrgname,c.amt
order by b.deptid