docs: def _fix_aggregates(self):
          """
          MSSQL doesn't match the behavior of the other backends on a few of
          the aggregate functions; different return type behavior, different
          function names, etc.
  
          MSSQL's implementation of AVG maintains datatype without proding. To
          match behavior of other django backends, it needs to not drop remainders.
          E.g. AVG([1, 2]) needs to yield 1.5, not 1
          """
          try:
              # for django 1.10 and up (works starting in 1.8 so I am told)
              select = self.query.annotation_select
          except AttributeError:
              # older
              select = self.query.aggregate_select
  
          for alias, aggregate in select.items():
              if not hasattr(aggregate, 'sql_function'):
                  continue
              if aggregate.sql_function == 'AVG':# and self.connection.cast_avg_to_float:
                  # Embed the CAST in the template on this query to
                  # maintain multi-db support.
                  select[alias].sql_template = \
                      '%(function)s(CAST(%(field)s AS FLOAT))'
              # translate StdDev function names
              elif aggregate.sql_function == 'STDDEV_SAMP':
                  select[alias].sql_function = 'STDEV'
              elif aggregate.sql_function == 'STDDEV_POP':
                  select[alias].sql_function = 'STDEVP'
              # translate Variance function names
              elif aggregate.sql_function == 'VAR_SAMP':
                  select[alias].sql_function = 'VAR'
              elif aggregate.sql_function == 'VAR_POP':
                  select[alias].sql_function = 'VARP'