时间:2021-07-01 10:21:17 帮助过:20人阅读
with c as (select a.trandt,sum(a.tranam) tranam from tran a group by a.trandt )--将子查询抽取出来,以后可以直接用。该方法只适用于oracle,mysql不支持 select c.trandt, sum(d.tranam) from c inner join c d on c.trandt >= d.trandt group by c.trandt select c.trandt, sum(d.tranam) from (select a.trandt, sum(a.tranam) tranam from tran a group by a.trandt order by a.trandt) c inner join (select a.trandt, sum(a.tranam) tranam from tran a group by a.trandt order by a.trandt) d on c.trandt >= d.trandt group by c.trandt
oracle数据库子查询的结果需要使用多次解决办法
标签:mys oracl class highlight 支持 直接 group 子查询 解决办法