Display the choices even if no rows found in associated table I have the following 3 tables for a small voting/polling feature:

CREATE TABLE IF NOT EXISTS `options` (
  `option_id` tinyint(4) unsigned NOT NULL,
  `poll_id` mediumint(8) unsigned NOT NULL,
  `option` tinytext NOT NULL,
  UNIQUE KEY `option_id_poll_id` (`option_id`,`poll_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Storing poll options/choices';

CREATE TABLE IF NOT EXISTS `questions` (
  `poll_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `question` tinytext NOT NULL,
  `nick` varchar(32) NOT NULL,
  `dated` datetime NOT NULL,
  PRIMARY KEY (`poll_id`),
  KEY `deleted` (`deleted`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table to store poll questions/titles';

CREATE TABLE IF NOT EXISTS `votes` (
  `poll_id` mediumint(8) unsigned NOT NULL,
  `option_id` tinyint(4) unsigned NOT NULL,
  `nick` varchar(32) NOT NULL,
  `dated` datetime NOT NULL,
  UNIQUE KEY `poll_id_nick` (`poll_id`,`nick`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


and I'm fetching the results of a certain poll_id (represented with %d below) using the following query:

SELECT
    o.option_id AS option_id,
    o.`option` AS `option`,
    COUNT(v.nick) AS total
FROM options o
LEFT JOIN votes v
    USING (poll_id)
WHERE o.poll_id = %d
    AND v.option_id = o.option_id
ORDER BY total DESC, o.option_id ASC


A sample can be seen on sqlfiddle. I'd like to retrieve all the options/choices available for any poll_id and display the COUNT as 0, or NULL; if no user chose that particular option. Thus, for the fiddle example, the result would be:

option_id | option | total
1         |   A    |   3
2         |   B    |   1
3         |   C    |   0
http://sqlfiddle.com/#!9/2a073/6 - "v.option_id = o.option_id" is supposed to be part of join condition so use ON instead of USING and move it there - when it is in WHERE, it works "after" the LEFT of join, so for not existing matches it is never true. And the group by per @ypercube is needed too.