Documentation Source Text

Check-in [003eb4df17]
Login

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

Overview
Comment:Type fixes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 003eb4df175f6d4e03354eb993c65288f8f69e3301110ef424f745c3e1f2a660
User & Date: drh 2019-09-27 11:30:22
Context
2019-09-27
11:30
Merge fixes from the 3.20 branch. check-in: de8b5d698b user: drh tags: trunk
11:30
Type fixes check-in: 003eb4df17 user: drh tags: trunk
2019-09-26
19:34
Update the RBU documentation to remove the constraint about it not working with indexes on expressions. check-in: e7771db6cc user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to pages/cli.in.

332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
....
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
hello         10    
goodbye       20    
sqlite>
}</tclscript>

<p>The ".width" command in the example above sets the width of the first
column to 12 and the width of the second column to 6.  All other column
widths were unaltered.  You can gives as many arguments to ".width" as
necessary to specify the widths of as many columns as are in your
query results.</p>

<p>If you specify a column a width of 0, then the column
width is automatically adjusted to be the maximum of three
numbers: 10, the width of the header, and the width of the
first row of data.  This makes the column width self-adjusting.
................................................................................
the temp.sqlite_parameters table if it does not already exist.  The ".param list"
command shows all entries in the temp.sqlite_parameters table.  The ".param clear"
command drops the temp.sqlite_parameters table.  The ".param set KEY VALUE" and
".param unset KEY" commands create or delete entries from the 
temp.sqlite_parameters table.

<p>The temp.sqlite_parameters table only provides values for parameters in the
command-line shell.  The temp.sqlite_parameter table has no affect on queries
that are run directly using the SQLite C-language API.  Individual applications
are expected to implement their own parameter binding.  You can search for 
"sqlite_parameters" in the 
[https://sqlite.org/src/file/src/shell.c.in|command-line shell source code]
to see how the command-line shell does parameter binding, and use that as
a hint for how to implement it yourself.








|







 







|







332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
....
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
hello         10    
goodbye       20    
sqlite>
}</tclscript>

<p>The ".width" command in the example above sets the width of the first
column to 12 and the width of the second column to 6.  All other column
widths were unaltered.  You can give as many arguments to ".width" as
necessary to specify the widths of as many columns as are in your
query results.</p>

<p>If you specify a column a width of 0, then the column
width is automatically adjusted to be the maximum of three
numbers: 10, the width of the header, and the width of the
first row of data.  This makes the column width self-adjusting.
................................................................................
the temp.sqlite_parameters table if it does not already exist.  The ".param list"
command shows all entries in the temp.sqlite_parameters table.  The ".param clear"
command drops the temp.sqlite_parameters table.  The ".param set KEY VALUE" and
".param unset KEY" commands create or delete entries from the 
temp.sqlite_parameters table.

<p>The temp.sqlite_parameters table only provides values for parameters in the
command-line shell.  The temp.sqlite_parameter table has no effect on queries
that are run directly using the SQLite C-language API.  Individual applications
are expected to implement their own parameter binding.  You can search for 
"sqlite_parameters" in the 
[https://sqlite.org/src/file/src/shell.c.in|command-line shell source code]
to see how the command-line shell does parameter binding, and use that as
a hint for how to implement it yourself.

Changes to pages/lang.in.

4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
....
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827

<p>^(If the FROM clause is omitted from a simple SELECT statement, then the 
input data is implicitly a single row zero columns wide)^ (i.e. <i>N</i>=1 and
<i>M</i>=0).

<p>If a FROM clause is specified, the data on which a simple SELECT query
operates comes from the one or more tables or subqueries (SELECT statements
in parenthesis) specified following the FROM keyword. ^A subquery specified
in the <yyterm>table-or-subquery</yyterm> following the FROM clause in a 
simple SELECT statement is
handled as if it was a table containing the data returned by executing the
subquery statement. ^Each column of the subquery has the
[collation|collation sequence] and [affinity] of the corresponding expression
in the subquery statement.

................................................................................
have the same value for "a".  But what is the result of the bare 
column "b"? The answer is that the "b" result will be the
value for "b" in one of the input rows that form the aggregate.
The problem is that you usually do not know which input row is used
to compute "b", and so in many cases the value for "b" is undefined.
</p>
<p>
Special processing occurs occurs when the aggregate function is 
either [maxAggFunc|min()] or [minAggFunc|max()].  Example:
<blockquote><pre>
SELECT a, b, max(c) FROM tab1 GROUP BY a;
</pre></blockquote>
When the [maxAggFunc|min()] or [minAggFunc|max()] aggregate functions 
are used in an aggregate query, all bare columns in the result set 
take values from the input







|







 







|







4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
....
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827

<p>^(If the FROM clause is omitted from a simple SELECT statement, then the 
input data is implicitly a single row zero columns wide)^ (i.e. <i>N</i>=1 and
<i>M</i>=0).

<p>If a FROM clause is specified, the data on which a simple SELECT query
operates comes from the one or more tables or subqueries (SELECT statements
in parentheses) specified following the FROM keyword. ^A subquery specified
in the <yyterm>table-or-subquery</yyterm> following the FROM clause in a 
simple SELECT statement is
handled as if it was a table containing the data returned by executing the
subquery statement. ^Each column of the subquery has the
[collation|collation sequence] and [affinity] of the corresponding expression
in the subquery statement.

................................................................................
have the same value for "a".  But what is the result of the bare 
column "b"? The answer is that the "b" result will be the
value for "b" in one of the input rows that form the aggregate.
The problem is that you usually do not know which input row is used
to compute "b", and so in many cases the value for "b" is undefined.
</p>
<p>
Special processing occurs when the aggregate function is 
either [maxAggFunc|min()] or [minAggFunc|max()].  Example:
<blockquote><pre>
SELECT a, b, max(c) FROM tab1 GROUP BY a;
</pre></blockquote>
When the [maxAggFunc|min()] or [minAggFunc|max()] aggregate functions 
are used in an aggregate query, all bare columns in the result set 
take values from the input