I have a table comments
id | comment | post_id |
1 Hey 1
2 Hey 2
3 Hey 2
4 Hey 3
5 Hey 1
I want to get 3 comments for each posts.
I did something like this below.
"select * from comments WHERE post_id IN(1,2,3) LIMIT 3"
But this yields me only 3 rows
.
But i want max 3 rows
for each post_id
not total 3 rows
.
Any help where i am going wrong ?