私は2つのテーブルを持っています。価格、code_one 別のテーブルの値でグループ化
code_two両方のテーブルがcode_one
テーブルを使用して参加することができ
- 最初のテーブルには列があります。
「価格の合計をcode_twoでグループ化する」方法
私が試した:
Select sum(price) from table1 Group By (select a.code_two from table2 a, table1 b where a.code_one = b.code_one)
@OMGポニーを:私は...グループ化した後、サブクエリを持つような何かを試してみました:GROUP BYが(、table2のからTABLE1をa.code_twoを選択b b.code_one = a.code_two) – Nik