1.機(jī)型統(tǒng)計(jì)
sql ="select 機(jī)型, sum(進(jìn)港) as 進(jìn)港,sum(出港) as 出港,sum(進(jìn)港)+sum(出港) as 小計(jì) " \
"from (select b.a10 as 機(jī)型, count(*) as 進(jìn)港, 0 as 出港 from (select * from app_airdata) b " \
"where b.d0 = 202009240500 and b.a2 = 0924 and b.a13 like '%s' group by b.a10 " \
"union all" \
" select c.a10 as 機(jī)型, 0 as 進(jìn)港, count(*) as 出港 from (select * from app_airdata) c " \
"where c.d0 = 202009240500 and c.a2 = 0924 and c.a18 like '%s' group by c.a10) " \
"a group by 機(jī)型 with rollup"%(das,das)