I am looking for a query that will return a count of the views
column based on a single user's id
.
Here is the table's contents:
id | post_id | user_id | views
1 | 4 | 67 | 4
1 | 56 | 67 | 3
1 | 34 | 67 | 10
I want to get the total of posts views the user have
SELECT *,count(views) from users WHERE user_id = 67
The result have to be 17