title: How to get the sum of foreign key table as a value in the primary table row in a select statement
body: <p>How to get the sum of foreign key table as a value in the primary table row in a select statement?</p>
  
  <p>Consider table 1:</p>
  
  <pre><code>id(PK)   name    description
  -----------------------------
  
   1       test1      desc1
   2       test2      desc2
  </code></pre>
  
  <p>Table 2 is:</p>
  
  <pre><code>id(FK)    value
  -----------------
   1         5
   1         6
   2         7
   2         8
  </code></pre>
  
  <p>The result for the SQL select statement should be like</p>
  
  <pre><code>id     name   desc    sum(value)
  ----------------------------------
   1     test1  desc1        11
  </code></pre>