统计某日的收费,按区域分组汇总

已知表 t_account (收费台账表)

自来水收费相关的sql语句题

已知表 t_area (区域表)

自来水收费相关的sql语句题

自来水收费相关的sql语句题

select (select name from t_area where ac.areaid = t_area.id ) 区域 ,
sum(ac.money) 收费, sum(ac.usenum)/1000 用水量吨
 from t_account ac
 where to_char(feedate,'yyyy-mm-dd') = '2012-08-14'  -- 某日
 group by ac.areaid  -- 按区域分组

统计某收费员某日的收费,按区域分组汇总

自来水收费相关的sql语句题

自来水收费相关的sql语句题

select (select name from t_area where ac.areaid = t_area.id ) 区域 ,
sum(ac.money) 收费, sum(ac.usenum)/1000 用水量吨
from t_account ac
where to_char(feedate,'yyyy-mm-dd') = '2012-08-14'  -- 某日
and ac.feeuser = 2 -- 某收费员
group by ac.areaid  -- 按区域分组

相关文章:

  • 2021-12-09
  • 2022-02-28
  • 2022-12-23
  • 2021-09-30
  • 2022-01-22
  • 2021-12-21
  • 2021-09-02
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案