A slightly confusing title. I will explain by example.
I have 2 tables - articles and headings. I have a set of id headings. I need one request to get the last 5 articles in each category from the list. MySQL database.
I couldn't think of anything else except how to use UNION .
SELECT * FROM article WHERE category_id = :id1 ORDER BY date_create DESC LIMIT 0, 5 UNION -- ... Is this me stupid or is there really no other way?