Try this query -
SELECT item_id, item_name, catid FROM
(SELECT t1.*, COUNT(*) cnt FROM items t1
LEFT JOIN items t2
ON t2.catid = t1.catid AND t2.item_id <= t1.item_id
GROUP BY
t1.catid, t1.item_id
) t
WHERE
cnt < 6
-- LIMIT 20
It will show first 5 items per category. Uncomment LIMIT 20
if you need. Join Categories
table if you need.