KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
+----------+----------+ | user_id | video_id | +----------+----------+ | 1 | 1 | | 1 | 1 | | 1 | 2 | | 2 | 1 | | 2 | 2 | +----------+----------+ I have a table setup similar to the one above. I would like to return a total count from my query. For each user_id they need to have a DISTINCT video_id . So above, user_id = 1 would have 2 unique video_id's and user_id = 2 would have 2 unique video_id's. This would make the total 4. I'm not sure the best way to organize my query to achieve the desired result. Basically for each user_id, I need something like, COUNT(DISTINCT video_id) I would like the final result just to return total count of everything.
Tags (comma-separated)
Save Edits
Cancel