有下列的一张表 t
id name profit month
1 aaa 666 202010
1 aaa 777 202011
1 aaa 888 202012
2 bbb 1122 202011
2 bbb 2342 202012
想生成
id 202010 202011 202012
1 666 777 888
2 0 1122 2342
我写的是
selest t.id,
sum(select profit from t where t.month = "202010") as 202010,
sum(select profit from t where t.month = "202011") as 202011,
sum(select profit from t where t.month = "202012") as 202012
from t
group by t.id
access查询说"子查询最多能返回一个记录"
请问正确的应该怎么写呀?