select x.icomcode as 코드
, sum((x.tmamoney1 - x.tbamoney1) - (x.cardvat1 + x.cardvat0)) as 현금매출
from outd_1511 x, comp c
where x.icomcode = c.comcode
and x.day1 >= '2015-11-01' and x.day1 <= '2015-11-15'
group by x.icomcode, c.comname order by icomcode
select x.icomcode as 코드
, sum((x.tmamoney1 - x.tbamoney1) - (x.cardvat1 + x.cardvat0)) as 현금과세
from outd_1511 x, comp c
where x.icomcode = c.comcode
and x.isvat = '1'
and x.day1 >= '2015-11-01' and x.day1 <= '2015-11-15'
group by x.icomcode, c.comname order by icomcode
select x.icomcode as 코드
, sum((x.tmamoney1 - x.tbamoney1) - (x.cardvat1 + x.cardvat0)) as 현금면세
from outd_1511 x, comp c
where x.icomcode = c.comcode
and x.isvat = '0'
and x.day1 >= '2015-11-01' and x.day1 <= '2015-11-15'
group by x.icomcode, c.comname order by icomcode |