Add documentation on the EXISTS expression. Ticket #1082. (CVS 2353)

FossilOrigin-Name: 76cacb4a39d2dd79a27624a8bd1ff65eeedd4ac8
This commit is contained in:
drh
2005-02-19 12:44:15 +00:00
parent e1b4f0374c
commit 0ab5fcccc7
3 changed files with 21 additions and 14 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
C Remove\sduplicate\sword\sfrom\sdocumentation.\s\sTicket\s#1103.\s(CVS\s2352)
D 2005-02-19T12:32:57
C Add\sdocumentation\son\sthe\sEXISTS\sexpression.\s\sTicket\s#1082.\s(CVS\s2353)
D 2005-02-19T12:44:16
F Makefile.in 76443a83549d1539105e12d13bd0054a05ab2214
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -257,7 +257,7 @@ F www/faq.tcl 1e348dec52dc0f21f4216fd6918c69c56daa4cfd
F www/fileformat.tcl 900c95b9633abc3dcfc384d9ddd8eb4876793059
F www/formatchng.tcl bfbf14dbf5181e771d06da7797767b0200b36d8a
F www/index.tcl e4e44a17a73510fdb5de7d3002815e7524e23433
F www/lang.tcl fad1d8d12b6c4e5185d9ca12c31c5cf7309b615c
F www/lang.tcl 0e5aeb09864b9ae0746d8afaa6377193f1553486
F www/lockingv3.tcl f59b19d6c8920a931f096699d6faaf61c05db55f
F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c
F www/nulls.tcl ec35193f92485b87b90a994a01d0171b58823fcf
@@ -274,7 +274,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
P 173aeb256e2c09098a4392874f8623e8a760d951
R f9212a99a84060ce314d0381c1afc5ba
P c1fc0a8aa96d2bd615f815b2477b801bda9e9c50
R 058fc001a82eb2a82cc843693727b03a
U drh
Z abd4f7a0c7d7a614def59e6a3e63adf5
Z ef9a2bd579709be8b4e9198f4f3f3df9
+1 -1
View File
@@ -1 +1 @@
c1fc0a8aa96d2bd615f815b2477b801bda9e9c50
76cacb4a39d2dd79a27624a8bd1ff65eeedd4ac8
+14 -7
View File
@@ -1,7 +1,7 @@
#
# Run this Tcl script to generate the lang-*.html files.
#
set rcsid {$Id: lang.tcl,v 1.83 2005/02/14 06:38:41 danielk1977 Exp $}
set rcsid {$Id: lang.tcl,v 1.84 2005/02/19 12:44:16 drh Exp $}
source common.tcl
if {[llength $argv]>0} {
@@ -903,7 +903,7 @@ Syntax {expr} {
<expr> [NOT] IN ( <value-list> ) |
<expr> [NOT] IN ( <select-statement> ) |
<expr> [NOT] IN [<database-name> .] <table-name> |
( <select-statement> ) |
[EXISTS] ( <select-statement> ) |
CASE [<expr>] LP WHEN <expr> THEN <expr> RPPLUS [ELSE <expr>] END
} {like-op} {
LIKE | NOT LIKE
@@ -1021,13 +1021,20 @@ of a row key in an UPDATE or INSERT statement.
"SELECT * ..." does not return the row key.</p>
<p>SELECT statements can appear in expressions as either the
right-hand operand of the IN operator or as a scalar quantity.
In both cases, the SELECT should have only a single column in its
right-hand operand of the IN operator, as a scalar quantity, or
as the operand of an EXISTS operator.
As a scalar quantity or the operand of an IN operator,
the SELECT should have only a single column in its
result. Compound SELECTs (connected with keywords like UNION or
EXCEPT) are allowed.
A SELECT in an expression is evaluated once before any other processing
is performed, so none of the expressions within the select itself can
refer to quantities in the containing expression.</p>
With the EXISTS operator, the columns in the result set of the SELECT are
ignored and the expression returns TRUE if one or more rows exist
and FALSE if the result set is empty.
If no terms in the SELECT expression refer to value in the containing
query, then the expression is evaluated once prior to any other
processing and the result is reused as necessary. If the SELECT expression
does contain variables from the outer query, then the SELECT is reevaluated
every time it is needed.</p>
<p>When a SELECT is the right operand of the IN operator, the IN
operator returns TRUE if the result of the left operand is any of