我想从销售表中汇总金额并希望按品牌对其进行分组,谁能帮我正确查询 php mysql。
--- product ---
id pcode pname brand
1 123 Dalda 1
2 124 Habib 1
3 125 Sufi 2
4 126 Toyota 3
--- sale ---
id pcode pname amount
1 123 Dalda 1020
2 123 Dalda 1020
3 124 Habib 1030
4 124 Habib 1030
5 125 Sufi 1040
6 125 Sufi 1040
7 126 Toyota 1050