diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
index f098910ea5..710eeebf8b 100644
--- a/src/wp-includes/comment.php
+++ b/src/wp-includes/comment.php
@@ -357,50 +357,63 @@ function get_comment_count( $post_id = 0 ) {
 	$where = '';
 	if ( $post_id > 0 ) {
 		$where = $wpdb->prepare("WHERE comment_post_ID = %d", $post_id);
-	}
 
-	$totals = (array) $wpdb->get_results("
-		SELECT comment_approved, COUNT( * ) AS total
-		FROM {$wpdb->comments}
-		{$where}
-		GROUP BY comment_approved
-	", ARRAY_A);
-
-	$comment_count = array(
-		'approved'            => 0,
-		'awaiting_moderation' => 0,
-		'spam'                => 0,
-		'trash'               => 0,
-		'post-trashed'        => 0,
-		'total_comments'      => 0,
-		'all'                 => 0,
-	);
-
-	foreach ( $totals as $row ) {
-		switch ( $row['comment_approved'] ) {
-			case 'trash':
-				$comment_count['trash'] = $row['total'];
-				break;
-			case 'post-trashed':
-				$comment_count['post-trashed'] = $row['total'];
-				break;
-			case 'spam':
-				$comment_count['spam'] = $row['total'];
-				$comment_count['total_comments'] += $row['total'];
-				break;
-			case '1':
-				$comment_count['approved'] = $row['total'];
-				$comment_count['total_comments'] += $row['total'];
-				$comment_count['all'] += $row['total'];
-				break;
-			case '0':
-				$comment_count['awaiting_moderation'] = $row['total'];
-				$comment_count['total_comments'] += $row['total'];
-				$comment_count['all'] += $row['total'];
-				break;
-			default:
-				break;
+		$totals = (array) $wpdb->get_results("
+			SELECT comment_approved, COUNT( * ) AS total
+			FROM {$wpdb->comments}
+			{$where}
+			GROUP BY comment_approved
+		", ARRAY_A);
+	
+		$comment_count = array(
+			'approved'            => 0,
+			'awaiting_moderation' => 0,
+			'spam'                => 0,
+			'trash'               => 0,
+			'post-trashed'        => 0,
+			'total_comments'      => 0,
+			'all'                 => 0,
+		);
+	
+		foreach ( $totals as $row ) {
+			switch ( $row['comment_approved'] ) {
+				case 'trash':
+					$comment_count['trash'] = $row['total'];
+					break;
+				case 'post-trashed':
+					$comment_count['post-trashed'] = $row['total'];
+					break;
+				case 'spam':
+					$comment_count['spam'] = $row['total'];
+					$comment_count['total_comments'] += $row['total'];
+					break;
+				case '1':
+					$comment_count['approved'] = $row['total'];
+					$comment_count['total_comments'] += $row['total'];
+					$comment_count['all'] += $row['total'];
+					break;
+				case '0':
+					$comment_count['awaiting_moderation'] = $row['total'];
+					$comment_count['total_comments'] += $row['total'];
+					$comment_count['all'] += $row['total'];
+					break;
+				default:
+					break;
+			}
 		}
+	} else {
+		$comment_count = array(
+			'approved'            => 0,
+			'awaiting_moderation' => $wpdb->get_var("SELECT COUNT( * ) FROM {$wpdb->comments} WHERE comment_approved = '0' "),
+			'spam'                => $spam = $wpdb->get_var("SELECT COUNT( * ) FROM {$wpdb->comments} WHERE comment_approved = 'spam' "),
+			'trash'               => $wpdb->get_var("SELECT COUNT( * ) FROM {$wpdb->comments} WHERE comment_approved = 'trash' "),
+			'post-trashed'        => $wpdb->get_var("SELECT COUNT( * ) FROM {$wpdb->comments} WHERE comment_approved = 'post-trashed' "),			
+			'all'                 => 0,
+		);
+		
+		$comment_count['total_comments'] = $wpdb->get_var("SELECT COUNT( * ) FROM {$wpdb->comments} ");
+		$comment_count['all'] = $comment_count['total_comments'];
+		$comment_count['approved'] = $comment_count['total_comments'] - $comment_count['spam'] - $comment_count['post-trashed'] - $comment_count['trash'] - $comment_count['awaiting_moderation'];
 	}
 
 	return $comment_count;
