diff --git a/src/applications/feed/query/PhabricatorFeedQuery.php b/src/applications/feed/query/PhabricatorFeedQuery.php --- a/src/applications/feed/query/PhabricatorFeedQuery.php +++ b/src/applications/feed/query/PhabricatorFeedQuery.php @@ -83,11 +83,11 @@ } private function buildGroupClause(AphrontDatabaseConnection $conn_r) { - return qsprintf( - $conn_r, - 'GROUP BY '.($this->filterPHIDs - ? 'ref.chronologicalKey' - : 'story.chronologicalKey')); + if ($this->filterPHIDs) { + return qsprintf($conn_r, 'GROUP BY ref.chronologicalKey'); + } else { + return qsprintf($conn_r, 'GROUP BY story.chronologicalKey'); + } } protected function getPagingColumn() {