title: Mysql limit left join
body: <p>I need help applying a limit to a Left Join in a Select query.</p>
  <p>I have a table with posts and another one with videos.
  I want to select a list of posts with some filters applied, and their respective videos, limited to 25 videos per post. Now I get ALL videos for a post, which could be hundreds and which is slow!</p>
  <p>My current Sql looks like this:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT `post`.`id` AS `post_id`,
         GROUP_CONCAT(CONCAT(`video`.`id`, ',', `video`.`timestamp`) SEPARATOR ';') AS `videos`,
         COUNT(`video`.`id`) AS `video_count`
    FROM `post`
         LEFT JOIN `video` -- Don't know how to limit these videos to 25 items
         ON `video`.`category_id` = `post`.`category_id`
         AND `video`.`file_size` &gt; 0
         AND `video`.`timestamp_beginning`
             BETWEEN `post`.`timestamp` - INTERVAL 5 MINUTE
             AND `post`.`timestamp` + INTERVAL 5 MINUTE
   WHERE `post`.`author_id` = 2 AND `post`.`status` = 'active'
   GROUP BY `post`.`id`
   ORDER BY `post`.`id` DESC
   LIMIT 100,100;
  </code></pre>
  <p>Thank you!</p>