From: drh Date: Sat, 19 Feb 2005 12:44:15 +0000 (+0000) Subject: Add documentation on the EXISTS expression. Ticket #1082. (CVS 2353) X-Git-Tag: version-3.6.10~3805 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ab5fcccc770d6775fc17b2ca589c1899151de20;p=thirdparty%2Fsqlite.git Add documentation on the EXISTS expression. Ticket #1082. (CVS 2353) FossilOrigin-Name: 76cacb4a39d2dd79a27624a8bd1ff65eeedd4ac8 --- diff --git a/manifest b/manifest index 3192603374..18c119357c 100644 --- a/manifest +++ b/manifest @@ -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 diff --git a/manifest.uuid b/manifest.uuid index df859f69d9..220f82bf21 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c1fc0a8aa96d2bd615f815b2477b801bda9e9c50 \ No newline at end of file +76cacb4a39d2dd79a27624a8bd1ff65eeedd4ac8 \ No newline at end of file diff --git a/www/lang.tcl b/www/lang.tcl index 08a7fe7cda..54195578ec 100644 --- a/www/lang.tcl +++ b/www/lang.tcl @@ -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} { [NOT] IN ( ) | [NOT] IN ( ) | [NOT] IN [ .] | -( ) | +[EXISTS] ( ) | CASE [] LP WHEN THEN RPPLUS [ELSE ] 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.

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.

+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.

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