diff --git a/db/models/sql/compiler.py b/db/models/sql/compiler.py
index eaf2cd2..be1b9d8 100644
--- a/db/models/sql/compiler.py
+++ b/db/models/sql/compiler.py
@@ -90,8 +90,9 @@ class SQLCompiler(object):
                 if not self.connection.features.allows_group_by_pk:
                     for col, col_params in ordering_group_by:
                         if col not in grouping:
-                            grouping.append(str(col))
-                            gb_params.extend(col_params)
+                            for order in ordering:
+                                if col in order:
+                                    ordering.remove(order)
             else:
                 ordering = self.connection.ops.force_no_ordering()
             result.append('GROUP BY %s' % ', '.join(grouping))
