Derby
  1. Derby
  2. DERBY-3635

Cannot build SELECT LIST expressions involving row_number()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Normal

      Description

      The row_number() windowing function does not behave like other expressions which appear in the SELECT LIST. With other SELECT LIST expressions, you can build up more complicated expressions. If we decide not to lift this limitation, we should probably at least mention it in the ROW_NUMBER section of the Derby Reference Manual.

      The following query works:

      select a + 1 as c, row_number() over () as row_number
      from t
      where a > 100 and a < 111
      ;

      The following query raises an error:

      select a, (row_number() over ()) + 1 as row_number
      from t
      where a > 100 and a < 111

      This is the error I see: "ERROR 42X01: Syntax error: Encountered "over" at line 2, column 25."

        Issue Links

          Activity

          Rick Hillegas created issue -
          Thomas Nielsen made changes -
          Field Original Value New Value
          Component/s SQL [ 11408 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Hide
          Knut Anders Hatlen added a comment -

          Triaged for 10.5.2. Unassigning since there has been no activity.

          Show
          Knut Anders Hatlen added a comment - Triaged for 10.5.2. Unassigning since there has been no activity.
          Knut Anders Hatlen made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Urgency Normal
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Link This issue relates to DERBY-3634 [ DERBY-3634 ]
          Hide
          Dag H. Wanvik added a comment -

          There is a patch under DERBY-3634 that fixes this issue as well; marking "patch available".

          Show
          Dag H. Wanvik added a comment - There is a patch under DERBY-3634 that fixes this issue as well; marking "patch available".
          Dag H. Wanvik made changes -
          Issue & fix info [Patch Available]
          Hide
          Dag H. Wanvik added a comment -

          DERBY-4413 has been resolved with a fix that fixes this issue as well, so resolving.

          Show
          Dag H. Wanvik added a comment - DERBY-4413 has been resolved with a fix that fixes this issue as well, so resolving.
          Dag H. Wanvik made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Issue & fix info [Patch Available]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12429373 ] Default workflow, editable Closed status [ 12798950 ]

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development