Hello,
Let’s say I’m displaying posts using a query (disregarding normalization) such as
SELECT * FROM posts WHERE foreign_id = x
Now, for every post I want to include what that user has on their Currently Watching list, up to 3 maximum.
So for every post I’m currently doing a
SELECT * FROM currently_watching WHERE user = x LIMIT 3
(if it were just one, i could’ve simply joined the table in the first query)
Could this be rewritten into a single query, preferably where the resulting rows would look something like
User | Message | Watching1 | Watching2 | Watching3
Thanks in advance,