select A.code,B.amount from A inner join B on A.id = B.id 1 2 1 3 2 1 怎么变成以下的形式? 1 5 2 1

2024-12-21 05:57:12
推荐回答(1个)
回答1:

select A.code,count(B.amount)
from A inner
join B
on A.id = B.id
group by A.code
order by A.code