I have two tables (news, seen) and the relation between them is 1 to many: one news has many sees.
I need an SQL Query to get each news with an additional alias column valued by the sum of each news sees.
Here is the structure of the both tables:
News: id_news, news_title, news_text, date, time, pic
Seen: id_seen, id_user, id_news, ip, fulldate, time
I need a query that retus the result like:
id_news | news_title | news_text | fulldate | fulltime | pic | seen_count (alias)
--------------------------------------------------------------------------------------
1 | Title Blah | Text Blah | Jun/03/2016 | 19:54:25 | 9.jpg | 934
2 | Title Blah | Text Blah | Jun/01/2016 | 19:24:25 | 6.jpg | 549
I tried lot of times but really couldn't achieve that.
