Here is my table arrangement:
Posts
post_id
post_votes
Comments
comment_id
post_id
comment_time
I have failed to create a query that does the following:
- Select 10 Posts Order By post_votes desc
- While getting 5 comments for each post
I will post what I have tried if necessary.
I am just getting into more complicated queries, any help or suggestions is greatly appreciated
The below will retrieve 10 post order by desc and also 5 comments order by desc respectively.
SQL FIDDLE HERE (testing sample of retrieving 3 post order by desc and also 2 comments for each post respectively).