Mijn knee-jerk is een subquery:
select count(capture_id) as count_captures,
(select count(id) as count_items
from items i where i.creator_user_id = captures.user_id) as count_items
from captures
where user_id = 9
Ik weet niet zo goed wat je kunt doen om dit te voorkomen. Je ziet verwacht (en over het algemeen gewenst gedrag).
Als u weet dat de ID's in beide zich niet herhalen, kunt u natuurlijk het volgende gebruiken:
SELECT COUNT( DISTINCT capture_id) as count_captures,
COUNT( DISTINCT items.id) as count_items
FROM captures
LEFT JOIN items ON captures.user_id = items.creator_user_id
WHERE user_id = 9