Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix for ticket #59: Add documentation for the || operator. Also added documentation for the new SQL92 join syntax. (CVS 608) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a0abef62bfe1b0f8c6249ba520dd2735 |
User & Date: | drh 2002-06-06 23:30:59.000 |
Context
2002-06-06
| ||
23:42 | Bug fix: do not segfault if a SELECT without a FROM clause includes the * wildcard in the result column list. (CVS 609) (check-in: d939294994 user: drh tags: trunk) | |
23:30 | Fix for ticket #59: Add documentation for the || operator. Also added documentation for the new SQL92 join syntax. (CVS 608) (check-in: a0abef62bf user: drh tags: trunk) | |
23:16 | Fix for ticket #62: Do not report an SQLITE_READONLY error until the application actually tries to write data into a readonly file. It is OK to start a transaction on a read-only file, and doing so will get you a read lock. This change allows TEMP tables to be read/write even though the main database is readonly. (CVS 607) (check-in: 9ef795d1d7 user: drh tags: trunk) | |
Changes
Changes to www/lang.tcl.
1 2 3 | # # Run this Tcl script to generate the sqlite.html file. # | | | 1 2 3 4 5 6 7 8 9 10 11 | # # Run this Tcl script to generate the sqlite.html file. # set rcsid {$Id: lang.tcl,v 1.38 2002/06/06 23:30:59 drh Exp $} puts {<html> <head> <title>Query Language Understood By SQLite</title> </head> <body bgcolor=white> <h1 align=center> |
︙ | ︙ | |||
600 601 602 603 604 605 606 | not talk about a standalone command but about "expressions" which are subcomponent of most other commands.</p> <p>SQLite understands the following binary operators, in order from highest to lowest precedence:</p> <blockquote><pre> | | > | | > > | 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | not talk about a standalone command but about "expressions" which are subcomponent of most other commands.</p> <p>SQLite understands the following binary operators, in order from highest to lowest precedence:</p> <blockquote><pre> <font color="#2c2cf0"><big>|| * / % + - << >> & | < <= > >= = == != <> </big>IN AND OR</font> </pre></blockquote> <p>Supported unary operaters are these:</p> <blockquote><pre> <font color="#2c2cf0"><big>- + ! ~</big></font> </pre></blockquote> <p>Any SQLite value can be used as part of an expression. For arithmetic operations, integers are treated as integers. Strings are first converted to real numbers using <b>atof()</b>. For comparison operators, numbers compare as numbers and strings compare as strings. For string comparisons, case is significant but is only used to break a tie. Note that there are two variations of the equals and not equals operators. Equals can be either} puts "[Operator =] or [Operator ==]. The non-equals operator can be either [Operator !=] or [Operator {<>}]. The [Operator ||] operator is \"concatenate\" - it joins together the two strings of its operands.</p>" puts { <p>The LIKE operator does a wildcard comparision. The operand to the right contains the wildcards.} puts "A percent symbol [Operator %] in the right operand matches any sequence of zero or more characters on the left. An underscore [Operator _] on the right |
︙ | ︙ | |||
1110 1111 1112 1113 1114 1115 1116 | [HAVING <expr>] [<compound-op> <select>]* [ORDER BY <sort-expr-list>] [LIMIT <integer> [OFFSET <integer>]] } {result} { <result-column> [, <result-column>]* } {result-column} { | | | > > > > | | > > | 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 | [HAVING <expr>] [<compound-op> <select>]* [ORDER BY <sort-expr-list>] [LIMIT <integer> [OFFSET <integer>]] } {result} { <result-column> [, <result-column>]* } {result-column} { STAR | <table-name> . STAR | <expr> [ [AS] <string> ] } {table-list} { <table> [<join-op> <table> <join-args>]* } {table} { <table-name> [AS <alias>] | ( <select> ) [AS <alias>] } {join-op} { , | [NATURAL] [LEFT | RIGHT | FULL] [OUTER | INNER] JOIN } {join-args} { [ON <expr>] [USING ( <id-list> )] } {sort-expr-list} { <expr> [<sort-order>] [, <expr> [<sort-order>]]* } {sort-order} { ASC | DESC } {compound_op} { UNION | UNION ALL | INTERSECT | EXCEPT } puts { <p>The SELECT statement is used to query the database. The result of a SELECT is zero or more rows of data where each row has a fixed number of columns. The number of columns in the result is specified by the expression list in between the SELECT and FROM keywords. Any arbitrary expression can be used as a result. If a result expression is } puts "[Operator *] then all columns of all tables are substituted" puts {for that one expression.</p> <p>The query is executed again one or more tables specified after the FROM keyword. If multiple tables names are separated by commas, then the query is against the cross join of the various tables. The full SQL-92 join syntax can also be used to specify joins. A sub-query in parentheses may be substituted for any table name in the FROM clause. The entire FROM clause may be omitted, in which case the result is a single row consisting of the values of the expression list. </p> <p>The WHERE clause can be used to limit the number of rows over which the query operates. In the current implementation, |
︙ | ︙ |