I have 2 tables:
1) game_follower (stores which user is following which game):
___________________________
| ID | game_id | user_id |
| 1 | 1 | 1 |
| 2 | 2 | 1 |
2) videos:
__________________________________
| ID | game_id | content | data |
| 1 | 2 | blah | blah |
| 2 | 1 | blah | blah |
I'm trying to implement a twitter-style following system, but I'm having trouble writing a query that does the following:
- select multiple game_ids WHERE user_id = "1"
- from that list of game_ids, select from videos where game_id = (multiple game ids that have been selected from the first query)
I can do it with separate queries but I've been told that using multiple queries is bad for performance, so how do I do this in with one query?