SyntaxFix
Write A Post
Hire A Developer
Questions
What about this?
SELECT c.id, c.title, (SELECT id from products AS p WHERE c.id = p.category_id ORDER BY ... LIMIT 1) FROM categories AS c;