title: Referring to an earlier aliased field in a criteria query
body: <p>In this query:</p>
  
  <pre><code>CriteriaBuilder cb = em.getCriteriaBuilder();
  CriteriaQuery&lt;Tuple&gt; q = cb.createTupleQuery();
  
  // FROM GamePlayedEvent gpe
  Root&lt;GamePlayedEvent&gt; gpe = q.from(GamePlayedEvent.class);
  // SELECT gameId, COUNT(*) AS count, AVG(duration)
  // AS avDur, AVG(rewardCurrency) AS avCur, AVG(rewardXP) avXp
  q.select(cb.tuple(
      gpe.&lt;String&gt;get("gameId"),
      cb.count(gpe).alias("count"),
      cb.avg(gpe.&lt;Double&gt;get("duration")).alias("avDur"),
      cb.avg(gpe.&lt;Integer&gt;get("rewardCurrency")).alias("avCur"),
      cb.avg(gpe.&lt;Integer&gt;get("rewardXp")).alias("avXp")
  ));
  // WHERE loginTime BETWEEN ...
  q.where(cb.between(gpe.&lt;Date&gt;get("time"), fromTime, toTime));
  // GROUP BY gameId
  q.groupBy(gpe.&lt;String&gt;get("gameId"));
  // ORDER BY count DESC
  q.orderBy(cb.desc(???));
  </code></pre>
  
  <p>How can I add the <code>ORDER BY count DESC</code>, referring to the "count" defined in the <code>SELECT</code> clause?</p>