I found this as a very common question when people start in sql. You can use sub-queries but I wouldn't recommend that as its slower and not scalable. So.. I like the method I show you bellow:
set @num := 0, @parent := 0; SELECT p.[yourFields],IF(@parent = p.id,@num:=@num+1,@num:=1) as matchNO, @parent:=p.id FROM parent p LEFT JOIN child c on c.p_id = p.id WHERE [yourFilters] having matchNO <= 3;
The row number is necessary to figure out in what row you are. The page variable tell you the page in the last row so you can compare and then set @num to 1 again when necesary.