答案 0 :(得分:0)
试试这个:
select
a.idprice,
sum(a.tax) + b.price as sum_price
from
tableA a
inner join
tableB b on b.idprice = a.idprice
group by
a.idprice,
b.price
答案 1 :(得分:0)
<强>查询强>
select t1.tax + t2.price as new_col_name
from
(
select idprice, sum(tax) as tax
from table1
group by idprice
) t1
join table2 t2
on t1.idprice = t2.idprice;
答案 2 :(得分:-1)
试试这个
Select (Sum(A.tax) + Sum(B.Price)) As Result
From TableA A Inner Join TableB B on A.idprice = B.idprice
Group By A.idprice