title: Sum Two Columns in Two Mysql Tables
body: <p>I've been searching everywhere for this but no cigar. Smoke is starting to come out of my ears. please help</p>
  
  <p>How do you sum two columns in two tables and group by userid?</p>
  
  <p>Have two tables.</p>
  
  <pre><code>Recipe Table
  recipeid   userid   recipe_num_views
  
  Meals Table
  mealsid   userid    meal_num_views 
  </code></pre>
  
  <p>Goal is to sum the num views in both tables and group by userid</p>
  
  <pre><code>so for example
  Recipe Table
  1    3     4
  2    4     6
  
  Meal Table
  1    3     2
  2    4     5
  
  
  select sum(recipe views)+sum(meal views) 
  WHERE recipe.userid=meals.userid GROUP BY userid
  </code></pre>
  
  <p>should give </p>
  
  <pre><code>userid=3 , sum=6
  userid=4, sum=11
  </code></pre>
  
  <p>this gives a much bigger number.</p>