I have a query like this one :
SELECT DISTINCT
`a`.*,
`b`.*,
`c`.*
FROM `a`
INNER JOIN `b` ON (`b`.`a_id` = `a`.`id` )
INNER JOIN `c` ON (`c`.`id` = `b`.`c_id`)
WHERE (
(`a`.`id` = 12345) AND
(`b`.`foo`= "bar")
)
Basically, this takes the row from a with id=12345, and the rows from b that concern this row, as well as the rows from c about this b rows, only of the rows in b have foo=bar
Right now, if there is no b row that has foo=bar, the a row is not even returned. This is wrong. I want that no matter what the matching a row is returned (whether there are bs and cs). How can I do this? (is there a way?)