使用wtih table as 方式试试
with t as select sum(A.qty), D.name from
A
inner join B on xxx
inner join C on xxx
inner join D on xxx
group by D.name
select * from t where t.name = ‘name1’
使用wtih table as 方式试试
with t as select sum(A.qty), D.name from
A
inner join B on xxx
inner join C on xxx
inner join D on xxx
group by D.name
select * from t where t.name = ‘name1’