title: Group by on a value from different table
body: <p>I have two tables. </p>
  
  <ul>
  <li>First table have columns: price, code_one</li>
  <li>Second table has: code_one, code_two</li>
  </ul>
  
  <p>Both tables could be joined using <code>code_one</code> table. </p>
  
  <p>How to have "Sum of prices grouped by code_two" ?</p>
  
  <p>I tried:</p>
  
  <pre><code>Select sum(price) from table1 Group By (select a.code_two from table2 a, table1 b where a.code_one = b.code_one)
  </code></pre>