title: SQLAlchemy OperationalError when offsetting and ordering by an aggregate column
body: <p>The following SQLAlchemy query compiles to illegal MSSQL. It looks like the generated MSSQL is attempting to sort by the original, non-aggregated column rather than the aggregated column specified in the SQLAlchemy query. This problem goes away if I change the label for the aggregate column; however, it's important to our application that this column has the same name as the column it aggregates over. I've scoured Google for the last couple of days, but I've not found any helpful suggestions; can someone help me understand what I'm doing wrong or how I can work around this problem?</p>
  
  <pre><code>price_sum = sqlalchemy.func.sum(
      table.c['Opportunity Max Amount']
  ).label('Opportunity Max Amount')
  
  query = sqlalchemy.select(
      columns=[price_sum],
      order_by=sqlalchemy.desc(price_sum),
      offset=1,
  ).alias("FOO")
  
  rows = conn.execute(query).fetchall()
  </code></pre>
  
  <p>The generated MSSQL:</p>
  
  <pre><code>SELECT anon_1.[Opportunity Max Amount]
  FROM (
      SELECT
          sum([table_name].[Opportunity Max Amount]) AS [Opportunity Max Amount],
          ROW_NUMBER() OVER (ORDER BY [Opportunity Max Amount] DESC) AS mssql_rn
      FROM [table_name]
  ) AS anon_1
  WHERE mssql_rn &gt; 1
  </code></pre>
  
  <p>The generated Postgres query (this query works as expected, and is provided here as a reference for what I'm trying to accomplish):</p>
  
  <pre><code>SELECT
      sum(performance_data."Opportunity Max Amount") AS "Opportunity Max Amount"
  FROM performance_data
  ORDER BY "Opportunity Max Amount" DESC
  LIMIT ALL
  OFFSET 1
  </code></pre>
  
  <p>The error message:</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (pymssql.OperationalError) (8120, b"Column
  'table_name.Opportunity Max Amount' is invalid in the
  select list because it is not contained in either an aggregate function or the
  GROUP BY clause.DB-Lib error message 20018, severity 16:\nGeneral SQL Server
  error: Check messages from the SQL Server\n") [SQL: 'SELECT anon_1.[Opportunity
  Max Amount] \nFROM (SELECT sum([table_name].[Opportunity
  Max Amount]) AS [Opportunity Max Amount], ROW_NUMBER() OVER (ORDER BY
  [Opportunity Max Amount] DESC) AS mssql_rn \nFROM
  [table_name]) AS anon_1 \nWHERE mssql_rn &gt; %(param_1)s']
  [parameters: {'param_1': 1}]
  </code></pre>