4 つのテーブルがあり、各テーブルのすべての価格の合計を計算する必要があります
1 テーブルスコム
_________________________________
| id | noskom | price_skom |
|____|_____________|____________|
| 1 | 1 | 10 |
| 2 | 2 | 30 |
|__3_|_3___________|___50_______|
2 テーブルスコップ
______________________________________________
| id | noskom | noskop | price_skop |
|____|_____________|____________|____________|
| 1 | 1 | 1 | 10 |
| 2 | 1 | 2 | 20 |
| 3 | 2 | 3 | 5 |
| 4 | 2 | 4 | 30 |
|____|_____________|____________|____________|
3 テーブル npbm
___________________________________________________________
| id | noskom | noskop | nonpbm | price_npbm |
|____|_____________|____________|____________|____________|
| 1 | 1 | 1 | 1 | 10 |
| 2 | 1 | 1 | 2 | 20 |
| 3 | 1 | 2 | 3 | 5 |
| 4 | 1 | 2 | 4 | 5 |
| 5 | 2 | 1 | 5 | 10 |
| 6 | 2 | 2 | 6 | 10 |
| 7 | 2 | 2 | 7 | 10 |
|____|_____________|____________|____________|____________|
4 テーブル npbp
________________________________________________________________________
| id | noskom | noskop | nonpbm | nonpbp | price_npbp |
|____|_____________|____________|____________|____________|____________|
| 1 | 1 | 1 | 1 | 1 | 10 |
| 2 | 1 | 1 | 2 | 2 | 20 |
| 3 | 1 | 2 | 3 | 3 | 5 |
| 4 | 1 | 2 | 4 | 4 | 5 |
| 5 | 2 | 1 | 5 | 5 | 10 |
| 6 | 2 | 2 | 6 | 6 | 10 |
| 7 | 2 | 2 | 7 | 10 | 10 |
|____|_____________|____________|____________|____________|____________|
そして、私はこのようなクエリの助けが必要です
select sum(price_skom),sum(price_skop),sum(price_npbm),sum(price_npbp) from each table group by noskom
このような結果が欲しい
noskom によるテーブル結果グループ
________________________________________________________________
| id | noskom | sum_skom | sum_skop | sum_npbm | sum_npbp |
|____|_____________|__________|__________|__________|__________|
| 1 | 1 | 10 | 30 | 40 | 90 |
| 2 | 2 | 30 | 35 | 30 | 70 |
|__3_|_3___________|___50_____|__________|__________|__________|
mysql クエリについて教えてください