Taking a blind stab, how about..
SELECT a.name, minimum(0,COUNT(b.id)) as votes FROM poll_options as a LEFT
JOIN poll_votes as b on a.id=b.oid
WHERE b.pid='' GROUP BY b.oid
Ryan Fox
- Original Message -
From: "Blaster" <[EMAIL PROTECTED]>
> However! Here comes the problem, if no vote is
LEFT JOIN
On Sat, 11 Jan 2003 18:35:44 +0100, Blaster used a few
recycled electrons to form:
| Hey,
|
| (this post is pretty long, a short version of the problem is listed at the
| bottom if you don't like reading long emails :P)
|
| I'm currently going through all my SQL queries for my webpa
You might have to tweak the following a bit for syntax:
SELECT a.name, COUNT(b.id) as votes FROM poll_options as a LEFT JOIN
poll_votes as b ON a.id=b.oid
WHERE b.pid='' GROUP BY b.oid
Also, you can refer to:
http://www.mysql.com/doc/en/JOIN.html
Bhavin.
- Original Message -
From: "