Documentation Source Text

Check-in [ab3b52646c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix typos in the windowfunction documentation.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ab3b52646c49d4daa9c1cbc7c4862089ec18b39ec0389058081c119b7f9da4da
User & Date: drh 2018-08-06 01:42:43
Context
2018-08-08
17:36
Fixes to the CGI handling in althttpd.c. check-in: 6faf1e47b9 user: drh tags: trunk
2018-08-06
01:42
Fix typos in the windowfunction documentation. check-in: ab3b52646c user: drh tags: trunk
2018-08-01
07:08
In althttpd.c, make sure all file descriptors other than 0, 1, and 2 are closed prior to launching CGI. check-in: c84d76df63 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to pages/windowfunctions.in.

    10     10   a "window" of one or more rows in the results set of a SELECT statement.
    11     11   
    12     12   
    13     13   <tcl>
    14     14   RecursiveBubbleDiagram window-function-invocation
    15     15   </tcl>
    16     16   
    17         -<p>Window functions are distingished from ordinary SQL functions by the
           17  +<p>Window functions are distinguished from ordinary SQL functions by the
    18     18   presence of an OVER clause.  If a function invocation has an OVER clause
    19     19   then it is a window function, and if lacks a OVER clause it is an ordinary
    20     20   function.  Window functions might also have a FILTER
    21     21   clause in between the function and the OVER clause.
    22     22   
    23     23   <p>Unlike ordinary functions, window functions
    24     24   cannot use the DISTINCT keyword.
................................................................................
    46     46     <i>-- </i>
    47     47     SELECT x, y, row_number() OVER (ORDER BY y) AS row_number FROM t0 ORDER BY x;
    48     48   </codeblock>
    49     49   
    50     50   <p>The example uses the built-in window function row_number().
    51     51   The row_number() window function
    52     52   assigns a monotonically increasing integer to each
    53         -row in order of the the "ORDER BY" clause within the
           53  +row in order of the "ORDER BY" clause within the
    54     54   <yynonterm>window-defn</yynonterm> (in this case "ORDER BY y"). Note that 
    55     55   this does not affect the order in which results are returned from
    56     56   the overall query.  The order of the final output is
    57         -is still governed by the ORDER BY clause attached to the SELECT
           57  +still governed by the ORDER BY clause attached to the SELECT
    58     58   statement (in this case "ORDER BY x").
    59     59   
    60     60   <p>Named <yynonterm>window-defn</yynonterm> clauses may also be added to a SELECT 
    61         -statement using a WINDOW clause and then refered to by name within window
           61  +statement using a WINDOW clause and then referred to by name within window
    62     62   function invocations. For example, the following SELECT statement contains
    63     63   two named <yynonterm>window-defs</yynonterm> clauses, "win1" and "win2":
    64     64   
    65     65   <codeblock>
    66     66     SELECT x, y, row_number() OVER <b>win1</b>, rank() OVER <b>win2</b> 
    67     67     FROM t0 
    68     68     WINDOW <b>win1</b> AS (ORDER BY y RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW),
................................................................................
   438    438            dense_rank() OVER win    AS dense_rank,
   439    439            percent_rank() OVER win  AS percent_rank,
   440    440            cume_dist() OVER win     AS cume_dist
   441    441     FROM t2
   442    442     WINDOW win AS (ORDER BY a);
   443    443   </codeblock>
   444    444   
   445         -<p>The example below uses ntile() to divde the six rows into two groups (the
          445  +<p>The example below uses ntile() to divide the six rows into two groups (the
   446    446   ntile(2) call) and into four groups (the ntile(4) call). For ntile(2), there
   447    447   are three rows assigned to each group. For ntile(4), there are two groups of
   448    448   two and two groups of one. The larger groups of two appear first.
   449    449   
   450    450   <codeblock>
   451    451     <i>-- The following SELECT statement returns:</i>
   452    452     <i>-- </i>