Hello,
I have a list of 9 user id's and want to select 3 entries per user id.
My current query looks like this.
SELECT * FROM entries WHERE user_id IN (1,2,3,4,5,6,7,8,9) LIMIT 27
Some users have many more than 3 entries, so I want to limit the results of this query to 3 entries per user.
I tried making a UNION of 9 separate queries where each queries has its own limit of 3, but this is very slow on the server.
Already I've looked for an answer to this on SO and I've found similar questions, but nothing matching the problem I am having. Any ideas?