I\'ve been searching everywhere for this but no cigar. Smoke is starting to come out of my ears. please help
How do you sum two columns in two tables and group by us
If you're selecting from 2 tables you need to join them. Otherwise MySQL will not know how to link up the two tables.
select sum(recipe_num_views + meal_num_views)
from recipe r
inner join meals m ON (r.user_id = m.user_id)
group by m.user_id
See:
http://dev.mysql.com/doc/refman/5.5/en/join.html
http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html