DB API: How to get a list of nodes ordered by highest comment creation date? The DB API is once again kicking my tail...

I've got a bunch of nodes of a certain type, each of which can have any number of comments, all in the usual way.  I'm trying to do a db_select()-based query that will give me the set of nodes of that type, ordered by the creation dates of each node's comments: The first node in the set would be the one that has the most recent comment, the second node would be the one that has the second most recent comment, and so on.  I'm sure / strongly suspect that this takes some sort of subquery, but I'm just not getting it right.  Can anyone offer some help?  Thanks!
The best place to query for that is the node_comment_statistics table.

It contains the relevant comment statistics such as comment count and last comment timestamp for a node.

e.g: Query for article nodes ordered by last_comment_timestamp DESC

$query = db_select('node_comment_statistics', 'c');
$query-&gt;join('node', 'n', 'n.nid = c.nid');
$query-&gt;fields('c', array('cid', 'last_comment_timestamp')); // fields
$query-&gt;fields('n', array('nid', 'title'));
$query-&gt;condition('n.type', 'article'); // e.g filter for articles only
$query-&gt;condition('n.status', 0, '&gt;');
$query-&gt;orderBy('c.last_comment_timestamp', 'DESC'); // Order by last commented
$results = $query-&gt;execute();

foreach($results as $row) {
  drupal_set_message('&lt;pre&gt;'.print_r($row,1).'&lt;/pre&gt;'); // debug
}


node_comment_statistics table schema:

mysql&gt; desc node_comment_statistics;
+------------------------+------------------+------+-----+---------+-------+
| Field                  | Type             | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+-------+
| nid                    | int(10) unsigned | NO   | PRI | 0       |       |
| cid                    | int(11)          | NO   |     | 0       |       |
| last_comment_timestamp | int(11)          | NO   | MUL | 0       |       |
| last_comment_name      | varchar(60)      | YES  |     | NULL    |       |
| last_comment_uid       | int(11)          | NO   | MUL | 0       |       |
| comment_count          | int(10) unsigned | NO   | MUL | 0       |       |
+------------------------+------------------+------+-----+---------+-------+