All pastes #78250 Raw Edit

Something

public sql v1 · immutable
·published 2006-07-03 22:52 UTC
rendered paste body
select A.answer, COUNT(V.answer_id) as votes from poll_answers ALEFT JOIN poll_votes V   ON A.poll_id = V.poll_id AND A.id = V.answer_idwhere A.poll_id = 4 and A.id = V.answer_id group by A.answer