Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6519

Non-aggregate query that uses measure in ORDER BY

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.38.0
    • None

    Description

      As of CALCITE-4496, a non-aggregate query can use measures in its SELECT clause; this change would further allow a non-aggregate query to use measures in its ORDER BY clause.

      An example such query:

      WITH empm AS
        (SELECT *, avg(sal) AS MEASURE avgSal FROM emp)
      SELECT avgSal, deptno
      FROM empm
      ORDER BY avgSal DESC LIMIT 3;
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: