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

Add QUALIFY clause

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.34.0
    • None

    Description

      QUALIFY is to Window functions what HAVING is to GROUP BY.

      For example:

      SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
      FROM t1
      QUALIFY row_num = 1
      

      Is the same as:

      SELECT *
      FROM (
          SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
          FROM t1)
      WHERE row_num = 1
      

      Attachments

        Issue Links

          Activity

            People

              bchong95 Brandon Chong
              bchong95 Brandon Chong
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m