Brug en ydre forbindelse:
select
a.activityName,
coalesce(sum(pt.remainderPoints), 0) points
from
activities a left outer join pointsTable pt on
pt.activityName = a.activityName and pt.UserID = 2
group by a.activityName
eller en underforespørgsel:
select
activities.ActivityName,
coalesce(
(select sum(RemainderPoints) from pointsTable where pointsTable.UserId = 2 and pointsTable.ActivityName = activities.ActivityName)
, 0) points
from
activities