Mysql limiting join?

Assuming you have some sort of unique id column in your file_screenshots table, this should work for you: SELECT c. *, fs. * FROM content c JOIN file_screenshots fs ON (fs.

Screenshot_content_id = c. Content_id) LEFT JOIN file_screenshots fs2 ON (fs2. Screenshot_content_id = c.

Content_id AND fs2. Id fs. Id).

Cheers that works really well, the only problem I could foresee is that it won't work if there are no screenshots, even if you use left join. For me that's not a problem right now, but it should be noted for anyone else reading this :) – Freeze Dried Pop Sep 22 at 11:01 @FreezeDriedPop Replace the first JOIN with a LEFT JOIN, and you should also get rows from content that have no corresponding rows in file_screenshots – Ivar Bonsaksen Sep 22 at 11:09.

I want to select from the "content" table, join the "file_screenshots" table but only select a maximum of 5 screenshots for any single piece of content. If this isn't possible i'm happy to use two queries, but again i'm not sure how to limit the results to only receiving 5 screenshots per piece of content.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions