Related articles with comments
You will need to join in the comment table and check the comment count.

...
LEFT JOIN {comment} c ON (c.nid = n.nid)
...
HAVING COUNT(c.cid) &gt; 0


The whole query would probably become something like this:

$row = db_query('
  SELECT nid \'id\',title \'name\', field_category_tid
  FROM {node} n
  LEFT JOIN {field_data_field_category} fdft ON (fdft.entity_id = n.nid AND bundle = :article AND entity_type = :node)
  LEFT JOIN {comment} c ON (c.nid = n.nid)
  WHERE type = :article AND status = :status AND fdft.field_category_tid = :cat
  HAVING COUNT(c.cid) &gt; 0
  ORDER BY title asc
  '.$limit, array(':cat' =&gt; $cat, ':article' =&gt; 'article', ':status' =&gt; NODE_PUBLISHED, ':node' =&gt; 'node'))-&gt;fetchAll(PDO::FETCH_OBJ);


Final note, what you want can be easily achieved with the Views module without having to write a query.

UPDATE: 

Count should be checked in HAVING.