0

How to fetch top x (say 2 - ordered by Score) posts for the give user ids (say 10 and 20) in a single query?

Table:

Posts

ID USER_ID CONTENT SCORE
1 10 C1 1
2 20 C2 2
3 10 C3 3
4 30 C4 4
5 10 C5 5
6 10 C6 6
7 20 C7 7
8 20 C8 8

Desired Output:

ID USER_ID CONTENT SCORE
5 10 C5 5
6 10 C6 6
7 20 C7 7
8 20 C8 8
2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.