Is it possible to LIMIT results from a JOIN query?
Posted
by Arms
on Stack Overflow
See other posts from Stack Overflow
or by Arms
Published on 2010-03-17T21:01:20Z
Indexed on
2010/03/17
21:31 UTC
Read the original article
Hit count: 308
I've got a query that currently queries a Post
table while LEFT JOINing a Comment
table. It fetches all Posts and their respective Comments. However, I want to limit the number of Comments returned. I tried adding a sub-select, but ran into errors if I didn't LIMIT the results to 1. I'm really not sure how to go about this while still using only one query. Is this possible?
© Stack Overflow or respective owner