I have two tables, the first is \'actions\' which has columns \'id\' and \'actionname\', the second is \'completedactions\' which has \'userid\' and \'actionid\'. They look
select
actions.id,
actions.actionname,
count(completedactions.actionid)
from actions
left join completedactions
on completedactions.actionid = actions.id and completedactions.userid = 1
group by 1,2