Refactoring SQL query for most recent posts.

As per title.