Documentation Source Text

Check-in [716c872b13]
Login

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

Overview
Comment:Updates to the aggregate function documentation.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 716c872b132b0e46dd022f25fee661ffab0697a5
User & Date: drh 2010-01-07 15:58:42
Context
2010-01-07
16:13
Add the "Search" menu option to the menu bar. check-in: 6e06b9d9b4 user: drh tags: trunk
15:58
Updates to the aggregate function documentation. check-in: 716c872b13 user: drh tags: trunk
2010-01-06
23:32
Simplifications to the description of keywords. Avoid any decision of the keywords that can, sometimes, be used as identifiers because that adds nothing to the conversation. check-in: a9db62dba3 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/lang.in.

2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
}

funcdef {sum(X) total(X)} {
  *sumFunc *sum *total
  {sum() aggregate function}
  {total() aggregate function}
} {
  The sum() aggregate function
  returns sum of all non-NULL values in the group.
  ^If there are no non-NULL input rows then sum() returns
  NULL but total() returns 0.0.
  ^NULL is not normally a helpful result for the sum of no rows
  but the SQL standard requires it and most other
  SQL database engines implement sum() that way so SQLite does it in the
  same way in order to be compatible.   ^The non-standard total() function
  is provided as a convenient way to work around this design problem
  in the SQL language.</p>

  <p>^The result of total() is always a floating point value.
  ^The result of sum() is an integer value if all non-NULL inputs are integers.
  ^If any input to sum() is neither an integer or a NULL
  then sum() returns a floating point value







|
|


|


|







2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
}

funcdef {sum(X) total(X)} {
  *sumFunc *sum *total
  {sum() aggregate function}
  {total() aggregate function}
} {
  ^The sum() and total() aggregate functions
  return sum of all non-NULL values in the group.
  ^If there are no non-NULL input rows then sum() returns
  NULL but total() returns 0.0.
  NULL is not normally a helpful result for the sum of no rows
  but the SQL standard requires it and most other
  SQL database engines implement sum() that way so SQLite does it in the
  same way in order to be compatible.   The non-standard total() function
  is provided as a convenient way to work around this design problem
  in the SQL language.</p>

  <p>^The result of total() is always a floating point value.
  ^The result of sum() is an integer value if all non-NULL inputs are integers.
  ^If any input to sum() is neither an integer or a NULL
  then sum() returns a floating point value