Using query_posts, how can I order the list of posts so the ones with the most recent comments are at the top?
I'm looking for something similar to how Questions here on SE are ordered when you sort by "Active."
I wouldn't use
Rather, I'd use a custom query. What you'll want to do is query approved comments sorted by their post/approval date and join that with the posts in your database. If a post doesn't have any comments, it would automatically be filtered out based on this criteria.
A very simple pseudo-code example:
Basically, you're selecting posts based on specific criteria related to data in the comments table. Using a direct query requires a certain depth of knowledge regarding SQL statements and the WP database structure, though ... so it's not usually my first recommendation, but should work in your case.
Just remember that the code above is pseudo-code ... meaning I made it up off the top of my head, it might not work, and you should only use it as a conceptual example.