How to select with INNER JOIN, giving related but also unrelated records

You could just left join:

SELECT u.name, g.type, COALESCE(g.quantity, 0) quantity
FROM users u  
LEFT JOIN gifts g ON g.boy_id = u.id

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top