WINDOW Syntax Argument Description window_function (Required) The window functions. [partitionby_function] (Optional) Divide the rows into partitions. [orderby_function] (Optional) Define the logical order of the rows within each partition [frame_function] (Optional) Specify start and end points to combine the rows to a window within the partition against the current row Usage notes WINDOW can only be passed with window functions, treats the entire rows as a window, and affects the sequence of the rows by PARTITIONBY, ORDERBY. PARTITIONBY Syntax Argument Description field_function (Required) The field name or formula be partitioned by. Usage notes PARTITIONBY divides the rows into partitions, and the window functions are applied in each partition separately, should have 1 or more parameters, for example: ORDERBY Syntax Argument Description field_function (Required) The field name or formula be ordered by. Argument Description field_function (Required) The field name or formula be ordered by. Usage notes ORDERBY defines the logical order of the rows within each partition. It will affect the window specified and calculation of the window functions, and should have 1 or more parameters. Use ORDERASC and ORDERDESC to indicate the sort order as ascending or descending. The default sort order is ORDERASC, for example: FRAMEROWS Syntax Argument Description preceding_function (Required) A row count preceding the current row. [following_function] (Optional) A row count following the current row. Usage notes FRAMEROWS limits the rowset of the window by specifying a nonnegative integer row count preceding or following the current row. The first parameter indicates the row count before the current row and accepts -1, [@-n] or [@], the second indicates the row count after the current row and accept -1, [@+n] or [@], -1 indicates the bounding of the current partition, the n accepts a nonnegative integer which indicates the row count, [@] indicates the current row, for example: FRAMERANGE Syntax Argument Description preceding_function (Required) A distance preceding the current row. [following_function] (Optional) A distance following the current row. Usage notes FRAMERANGE limits the range of the window by specifying a nonnegative number as the distance around some values from peer rows that have the same value in the current row composed of the ORDERBY columns. The first parameter indicates the distance before peer rows of the current row and accepts -1, [@-n](if the order is descending, it should be [@+n]) or [@]. The second parameter indicates the distance after peer rows of the current row and accept -1, [@+n](if the order is descending, it should be [@-n]) or [@]. -1 indicates the bounding of the current partition, n accepts a nonnegative integer which indicates the distance, and [@] indicates the peer rows which have the same value in the current row. The range is a fully closed interval, and requires ORDERBY to provide the first column with a numeric data type. If there are more than 1 ordered columns, only -1 and [@] accepted, for example: