simply replace the INNER
with LEFT
ought to do it...
by the way you don't really need that subquery
its hard to be sure, but from your description I think something like this is what you want??
SELECT k.id AS child_id,
k.kw_name AS child_name,
k.kw_desc AS child_desc,
COUNT(rb.conn_id) AS out_degree
FROM connection AS ra
LEFT JOIN keyword As k ON ra.kw2id = k.id AND ra.reltype = 'blah'
LEFT JOIN connection As rb ON rb.kw1id = k.id AND rb.reltype = 'blah'
WHERE ra.kw1id = [ID_CLICKED]
GROUP BY k.id
ORDER BY out_degree DESC
This should count the children of the children of [ID_CLICKED] and should still include the childless
To avoid multiple counting, change this:
COUNT(rb.conn_id) AS out_degree
to
COUNT(distinct rb.kw2id) AS out_degree
so each grand child only gets counted once