Is there a way to select first 2 answers for each Qs from answers table:
user_answers Table structure:
id question_id user_id answer_id create_date
1 1 9 5 null
2 2 8 7 null
3 1 1 3 null
4 3 4 20 null
5 1 4 5 null
6 4 3 25 null
7 2 7 5 null
8 4 9 26 null
9 2 5 8 null
10 1 1 5 null
I need to return results like this:
id question_id user_id answer_id create_date
1 1 9 5 null
3 1 1 3 null
2 2 8 7 null
7 2 7 5 null
4 3 4 20 null
6 4 3 25 null
8 4 9 26 null
It's like Group by "question_id" but select first 2 rows from each group,
thanks,