Hi everybody!

Let's have three tables:

CREATE TABLE `shop` (
`shop_id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`shop_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `soft` (
`soft_id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`soft_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `soft_shop_r` (
`soft_id` int(11) NOT NULL default '0',
`shop_id` int(11) NOT NULL default '0',
PRIMARY KEY (`soft_id`,`shop_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

With this data:

INSERT INTO `shop` (`shop_id`) VALUES
(1),
(2);

INSERT INTO `soft` (`soft_id`) VALUES
(1),
(2);

INSERT INTO `soft_shop_r` (`soft_id`, `shop_id`) VALUES
(1,1),
(1,2),
(1,3),
(2,1);


I want to know on HOW MANY shops is selling each software. So I've written this query:

SELECT
soft.soft_id,
COUNT(shop.shop_id) AS countshops
FROM
shop
INNER JOIN soft_shop_r ON (shop.shop_id=soft_shop_r.shop_id)
INNER JOIN soft ON (soft_shop_r.soft_id=soft.soft_id)
GROUP BY
soft.soft_id


The problem is that this query only results values for soft1 and soft2 (soft1 being sell in 3 shops and soft2 in 1). Soft3, that's not selling anywhere doesn't appear at all.
I'll want to show all the values in table "soft", even if the value of COUNT(shop_shop_id) is 0 (Null).

Could anyone help me?
Thanks!

Eneko Illarramendi