Lines Matching refs:FROM

3418 ** "SELECT count(*) FROM tab") then the [SQLITE_READ] authorizer callback
4614 ** SELECT eval('DELETE FROM t1') FROM t2;
5085 ** SELECT c1 + 1, c1 FROM t1;
7803 ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
9966 ** returns false for the enhanced [UPDATE FROM] statement.
10058 ** (or "IS NOT DISTINCT FROM") and not "==".
10889 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
10915 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
12831 ** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid
12893 ** SELECT count(*) FROM ftstable;
18572 ** The SrcItem object represents a single term in the FROM clause of a query.
18645 ** is used to hold the FROM clause of a SELECT statement. SrcList also
18650 int nSrc; /* Number of tables or subqueries in the FROM clause */
18705 ** be NULL. The pSrc corresponds to the FROM clause of a SELECT or
18831 SrcList *pSrc; /* The FROM clause */
18863 #define SF_HasTypeInfo 0x0000080 /* FROM subqueries have Table metadata */
18867 #define SF_NestedFrom 0x0000800 /* Part of a parenthesized FROM clause */
18879 #define SF_UFSrcCheck 0x0800000 /* Check pSrc as required by UPDATE...FROM */
19384 SrcList *pFrom; /* FROM clause for UPDATE statement (if any) */
19568 SrcList *pSrcList; /* FROM clause */
19580 SrcItem *pSrcItem; /* A single FROM clause item */
31637 sqlite3TreeViewLine(pView, "FROM");
32168 sqlite3TreeViewLine(pView, "First FROM table rowid");
32170 sqlite3TreeViewLine(pView, "First FROM table column %d",
32363 sqlite3TreeViewLine(pView, "FROM");
32502 sqlite3TreeViewLine(pView, "FROM");
83272 ** where a "DELETE FROM tbl" has a statement-journal but does not
97202 "SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid",
103574 ** FROM clause of SELECT statement p. Do not invoke the select
103575 ** callback on p, but do invoke it on each FROM clause subquery
103602 ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
103606 ** the walk of the expressions and FROM clause. The xSelectCallback2()
103607 ** method is invoked following the walk of the expressions and FROM clause,
103609 ** and if the expressions and FROM clause both return WRC_Continue;
103731 ** SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase;
103735 ** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
103983 ** parenthesized subset of the FROM clause terms. Example:
103984 ** .... FROM t1 LEFT JOIN (t2 RIGHT JOIN t3 USING(x)) USING(y) ...
104229 ** SELECT a+b AS x FROM table WHERE x<10;
104552 ** column in the FROM clause. This is used by the LIMIT and ORDER BY
104554 ** UPDATE ... FROM statement processing.
105427 /* Recursively resolve names in all subqueries in the FROM clause
105612 ** Y: The name of a table in a FROM clause. Or in a trigger
105632 ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;
105636 ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;
105734 ** subqueries in expressions, and subqueries used as FROM clause
105854 ** SELECT * FROM t1 WHERE a;
105855 ** SELECT a AS b FROM t1 WHERE b;
105856 ** SELECT * FROM t1 WHERE (select a from t1);
107668 ** Or: (a,b,c) = (SELECT x,y,z FROM ....)
108415 if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
108416 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
108419 assert( !IsView(pTab) ); /* FROM clause is not a view */
108420 if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */
108494 ** SELECT <column1>, <column2>... FROM <table>
108547 ** (?,?,?) IN (SELECT a, b, c FROM t1)
108610 /* The "x IN (SELECT rowid FROM table)" case */
108848 ** x IN (SELECT a FROM b) -- IN operator with subquery on the right
109053 ** (SELECT a FROM b) -- subquery
109054 ** EXISTS (SELECT a FROM b) -- EXISTS subquery
111860 ** When entering a new subquery on the pExpr argument, add all FROM clause
112078 /* Check to see if the column is in one of the tables in the FROM
112087 ** that is in the FROM clause of the aggregate query.
112389 "FROM \"%w\"." LEGACY_SCHEMA_TABLE " "
112400 "FROM temp." LEGACY_SCHEMA_TABLE " "
112626 "SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"",
112781 " FROM pragma_quick_check(%Q,%Q)"
114187 ** 'CREATE VIEW v1 AS SELECT "a", "string" FROM t1'
114192 ** CREATE VIEW v1 AS SELECT "a", 'string' FROM t1
114835 "DELETE FROM %Q.%s WHERE %s=%Q",
114840 sqlite3NestedParse(pParse, "DELETE FROM %Q.%s", pDb->zDbSName, zTab);
116309 ** zSql1: SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx
116310 ** zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4
116444 "SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx",
116445 "SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4",
116506 "SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase);
120556 ** CREATE VIEW one AS SELECT * FROM two;
120557 ** CREATE VIEW two AS SELECT * FROM one;
120564 ** CREATE TEMP VIEW ex1 AS SELECT a FROM ex1;
120565 ** SELECT * FROM temp.ex1;
120576 ** to the elements of the FROM clause. But we do not want these changes
120813 "DELETE FROM %Q.%s WHERE %s=%Q",
120859 "DELETE FROM %Q.sqlite_sequence WHERE name=%Q",
120873 "DELETE FROM %Q." LEGACY_SCHEMA_TABLE
122082 "DELETE FROM %Q." LEGACY_SCHEMA_TABLE " WHERE name=%Q AND type='index'",
122195 ** The SrcList object is used to represent the FROM clause of a
122246 sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
122401 ** end of a growing FROM clause. The "p" parameter is the part of
122402 ** the FROM clause that has already been constructed. "p" is NULL
122403 ** if this is the first term of the FROM clause. pTable and pDatabase
122404 ** are the name of the table and database named in the FROM clause term.
122412 ** Return a new SrcList which encodes is the FROM with the new
122417 SrcList *p, /* The left part of the FROM clause already seen */
122418 Token *pTable, /* Name of the table to add to the FROM clause */
122537 ** When building up a FROM clause in the parser, the join operator
122540 ** Shifts all join operators from left to right for an entire FROM
123710 ** in order to generate code for DELETE FROM statements.
123716 ** (as in the FROM clause of a SELECT statement) in this case it contains
123870 ** DELETE FROM table_wxyz WHERE a<5 ORDER BY a LIMIT 1;
123876 SrcList *pSrc, /* the FROM clause -- which tables to scan */
123886 SrcList *pSelectSrc = NULL; /* SELECT rowid FROM x ... (dup of pSrc) */
123908 ** DELETE FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
123910 ** DELETE FROM table_a WHERE rowid IN (
123911 ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
123940 /* duplicate the FROM clause as it is needed by both the DELETE/UPDATE tree
123968 ** Generate code for a DELETE FROM statement.
123970 ** DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
127855 ** then the equivalent of "DELETE FROM <tbl>" is executed before dropping
128067 ** case SQLite runs a "DELETE FROM xxx" on the table being dropped
128325 ** DELETE FROM c WHERE ck = old.pk;
129202 ** for a SELECT statement that omits the FROM clause and everything else
129220 ** If the SELECT clause is of the restricted form "SELECT * FROM <table2>" -
129413 ** INSERT INTO <table1> SELECT * FROM <table2>;
131360 ** INSERT INTO tab1 SELECT * FROM tab2;
131391 Table *pSrc; /* The table in the FROM clause of SELECT */
131421 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
131423 return 0; /* FROM clause must have exactly one term */
131426 return 0; /* FROM clause cannot contain a subquery */
131465 return 0; /* FROM clause does not contain a real table */
131500 ** INSERT INTO t2 SELECT * FROM t1;
135506 char *zSql = sqlite3MPrintf(db, "SELECT*FROM\"%w\"", pTab->zName);
137508 "SELECT*FROM\"%w\".%s ORDER BY rowid",
138248 ** SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10;
138335 SrcList *pSrc, /* the FROM clause -- which tables to scan */
138608 ** SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
138687 ** The terms of a FROM clause are contained in the Select.pSrc structure.
138697 SrcList *pSrc; /* All tables in the FROM clause */
139212 ** SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10
139567 /* If the UPDATE FROM join is an aggregate that matches no rows, it
140088 ** SELECT col FROM tbl;
140089 ** SELECT (SELECT col FROM tbl;
140090 ** SELECT (SELECT col FROM tbl);
140091 ** SELECT abc FROM (SELECT col AS abc FROM tbl);
140152 ** SELECT (SELECT t1.col) FROM FROM t1;
140167 /* The "table" is actually a sub-select or a view in the FROM clause
140776 ** There is exactly one reference to the recursive-table in the FROM clause
140808 SrcList *pSrc = p->pSrc; /* The FROM clause of the recursive query */
141035 ** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3
141039 ** SELECT c FROM t3
141041 ** `-----> SELECT b FROM t2
141043 ** `------> SELECT a FROM t1
141993 ** SELECT a,b,m,x FROM t1 LEFT JOIN (SELECT 59 AS m,x FROM t2) ON b=x;
142021 ** FROM clause of a SELECT such that the VDBE cursor assigned to that
142164 ** pSelect is a SELECT statement and pSrcItem is one item in the FROM
142181 SrcItem *pSrcItem /* Which FROM clause item to recompute */
142206 ** on the FROM clause of each such sub-select, with iExcept set to -1.
142211 SrcList *pSrc, /* FROM clause to renumber */
142212 int iExcept /* FROM clause item to skip */
142258 ** Assign a new cursor number to each cursor in the FROM clause (Select.pSrc)
142260 ** cursor in the FROM clause of any FROM clause sub-selects, recursively.
142262 ** the FROM clause of (*p). Update all expressions and other references
142272 ** FROM clauses of the select statement as described above are
142278 int iExcept, /* FROM clause item to skip */
142311 ** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5
142323 ** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5
142339 ** other than the one FROM-clause subquery that is a candidate
142345 ** (3b) the FROM clause of the subquery may not contain a virtual
142361 ** (7) The subquery must have a FROM clause. TODO: For subqueries without
142362 ** A FROM clause, consider adding a FROM clause with the special
142396 ** (17c) every term within the subquery compound must have a FROM clause
142447 ** "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily
142486 SrcList *pSrc; /* The FROM clause of the outer query */
142487 SrcList *pSubSrc; /* The FROM clause of the subquery */
142672 ** SELECT <expr-list> FROM (<sub-query>) <where-clause>
142682 ** SELECT a+1 FROM (
142683 ** SELECT x FROM tab
142685 ** SELECT y FROM tab
142687 ** SELECT abs(z*2) FROM tab2
142692 ** SELECT x+1 FROM tab WHERE x+1!=5
142694 ** SELECT y+1 FROM tab WHERE y+1!=5
142696 ** SELECT abs(z*2)+1 FROM tab2 WHERE abs(z*2)+1!=5
142764 ** This loop moves all of the FROM elements of the subquery into the
142765 ** the FROM clause of the outer query. Before doing this, remember
142766 ** the cursor number for the original outer query FROM element in
142769 ** those references with expressions that resolve to the subquery FROM
142778 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
142779 nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */
142780 pSrc = pParent->pSrc; /* FROM clause of the outer query */
142786 /* The subquery uses a single slot of the FROM clause of the outer
142787 ** query. If the subquery has more than one element in its FROM clause,
142793 ** SELECT * FROM tabA, (SELECT * FROM sub1, sub2), tabB;
142795 ** The outer query has 3 slots in its FROM clause. One slot of the
142797 ** block of code will expand the outer query FROM clause to 4 slots.
142799 ** for the two elements in the FROM clause of the subquery.
142807 /* Transfer the FROM clause terms from the subquery into the
142827 ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b;
142882 ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y;
143104 ** SELECT * FROM t1, t2, t3 WHERE t1.a=39 AND t2.b=t1.a AND t3.c=t2.b
143108 ** SELECT * FROM t1, t2, t3 WHERE t1.a=39 AND t2.b=39 AND t3.c=39
143117 ** SELECT * FROM t1 WHERE a=123 AND b=a;
143118 ** SELECT * FROM t1 WHERE a=123 AND b=123;
143134 ** SELECT 1 FROM t1 WHERE x=10 AND x LIKE 10;
143191 ** push WHERE clause expression pExpr down to FROM clause sub-query
143221 ** SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10;
143225 ** SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10)
143255 ** FROM (SELECT 1 AS a1 UNION ALL SELECT 2) AS aa
143296 SrcItem *pSrc /* The subquery term of the outer FROM clause */
143447 ** SELECT count(*) FROM <tbl>
143523 ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
143527 ** SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2)
143601 ** Check to see if the FROM clause term pFrom has table-valued function
143617 ** FROM clause element pItem is really a common-table-expression (CTE)
143626 SrcItem *pItem, /* FROM clause element to resolve */
143697 SrcItem *pFrom /* The FROM clause term to check */
143713 /* The FROM term contains a schema qualifier (ex: main.t1) and so
143718 /* The FROM term is specifically excluded from matching a CTE.
143721 ** (2) This is the first term in the FROM clause of an UPDATE.
143876 ** names and other FROM clause elements.
143892 ** sub-query in the FROM clause of a SELECT statement. This function
143954 ** element of the FROM clause.
143957 ** defines FROM clause. When views appear in the FROM clause,
144010 ** the FROM clause of the SELECT statement.
144014 /* Look up every table named in the FROM clause of the select. If
144015 ** an entry of the FROM clause is a subquery instead of a table or view,
144026 /* A sub-query in the FROM clause of a SELECT */
144039 /* An ordinary table or view name in the FROM clause */
144162 ExprList *pNestedFrom; /* Result-set of a nested FROM clause */
144373 ** For each FROM-clause subquery, add Column.zType and Column.zColl
144397 /* A sub-query in the FROM clause of a SELECT */
144412 ** the Table structures of all FROM-clause subqueries in a
144433 ** * VDBE Cursor numbers are assigned to all FROM-clause terms.
144434 ** * Ephemeral Table objects are created for all FROM-clause subqueries.
144633 ** count(*) query ("SELECT count(*) FROM pTab").
144699 ** SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=?
144703 ** SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=?
144730 SrcList *pTabList, /* Search for self-joins in this FROM clause */
144748 ** names in the same FROM clause. */
144774 ** SELECT count(*) FROM (SELECT x FROM t1 UNION ALL SELECT y FROM t2)
144778 ** SELECT (SELECT count(*) FROM t1)+(SELECT count(*) FROM t2)
144805 if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
144807 if( pSub==0 ) return 0; /* The FROM is a subquery */
144976 ** as part of populating the temp table for an UPDATE...FROM statement.
144978 ** or alias is duplicated within FROM clause (pSrc->a[1..n]).
144988 "target object/alias may not appear in FROM clause: %s",
145023 ** reduction of join operators) in the FROM clause up into the main query
145032 ** even for FROM clause elements such as subqueries that do not correspond
145051 /* No futher action if this term of the FROM clause is no a subquery */
145072 /* If a FROM-clause subquery has an ORDER BY clause that is not
145083 ** (3) The subquery is in the FROM clause of an UPDATE
145100 ("omit superfluous ORDER BY on %r FROM-clause subquery\n",i+1));
145114 ** FROM (SELECT x FROM tab ORDER BY y LIMIT 10);
145123 ** SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10);
145194 /* For each term in the FROM clause, do two things:
145212 ** SELECT count(*) FROM t1; -- SQLITE_READ t1.""
145213 ** SELECT t1.* FROM t1, t2; -- SQLITE_READ t2.""
145228 /* Generate code for all sub-queries in the FROM clause
145316 ** this same FROM clause. Reuse it. */
145378 SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
145387 ** SELECT DISTINCT xyz FROM ... ORDER BY xyz
145391 ** SELECT xyz FROM ... GROUP BY xyz ORDER BY xyz
145967 ** SELECT count(*) FROM <tbl>
146896 SrcList *pFrom, /* FROM clause for an UPDATE-FROM, or NULL */
147055 "DELETE FROM %Q." LEGACY_SCHEMA_TABLE " WHERE name=%Q AND type='trigger'",
147993 ** SELECT <other-columns>, pChanges FROM pTabList WHERE pWhere
148001 ** SELECT <other-columns>, pChanges FROM pTabList
148118 ** UPDATE OR IGNORE tbl SET a=b, c=d FROM tbl2... WHERE e<5 AND f NOT NULL;
148180 int nChangeFrom = 0; /* If there is a FROM, pChanges->nExpr, else 0 */
148230 /* If there was a FROM clause, set nChangeFrom to the number of expressions
148231 ** in the change-list. Otherwise, set it to 0. There cannot be a FROM
148308 /* If this is an UPDATE with a FROM clause, do not resolve expressions
149454 SrcList *pSrc; /* FROM clause for the UPDATE */
149803 "SELECT sql FROM \"%w\".sqlite_schema"
149810 "SELECT sql FROM \"%w\".sqlite_schema"
149818 ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy
149823 "||' SELECT*FROM\"%w\".'||quote(name)"
149824 "FROM vacuum_db.sqlite_schema "
149839 " SELECT*FROM \"%w\".sqlite_schema"
151374 ** each term in the FROM clause (which is to say, for each of the
151397 u8 iFrom; /* Which entry in the FROM clause */
151414 Bitmask notReady; /* FROM entries not usable at this level */
151422 ** term of a join. Every term of the FROM clause will have at least
151425 ** FROM clause will have multiple WhereLoop objects, each describing a
151426 ** potential way of implementing that FROM-clause term, together with
151431 ** one WhereLoop object per FROM clause term, that satisfy all dependencies
151440 u8 iTab; /* Position in FROM clause of table for this loop */
151509 ** number of nodes in the FROM clause. The best (lowest cost) WherePath
151746 ** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM
151844 SrcList *pSrclist, /* FROM clause pLvl reads data from */
152006 ** SELECT * FROM t1 WHERE a=1 AND b>2;
152207 ** implement level pLvl. Argument pSrclist is a pointer to the FROM
152215 SrcList *pSrclist, /* FROM clause pLvl reads data from */
152240 ** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
152241 ** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
152242 ** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
152383 ** SELECT * FROM t1 WHERE (a,b,c,d,e) IN (SELECT v,w,x,y,z FROM t2)
152390 ** (e,c) IN (SELECT z,x FROM t2)
152488 WhereLevel *pLevel, /* The level of the FROM clause we are working on */
152680 ** SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b;
152690 WhereLevel *pLevel, /* Which nested loop of the FROM we are coding */
152752 ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */
152945 SrcItem *pTabItem, /* FROM clause item */
153258 SrcItem *pTabItem; /* FROM clause term being coded */
153325 /* Special case of a FROM clause subquery implemented as a co-routine */
154020 ** SELECT * FROM t1 WHERE a=5 OR b=7 OR (c=11 AND d=13)
155210 SrcList *pSrc, /* the FROM clause */
155337 SrcList *pSrc, /* the FROM clause */
155673 SrcList *pFrom, /* The FROM clause */
155674 Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
155698 SrcList *pFrom, /* The FROM clause */
155699 Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
155746 SrcList *pSrc, /* the FROM clause */
156299 ** single virtual table in the FROM clause of the SELECT.
156489 SrcList *pTabList, /* the FROM clause */
156507 SrcItem *pItem, /* The FROM clause term to process */
156833 ** There is one cursor per table in the FROM clause. The number of
156834 ** tables in the FROM clause is limited by a test early in the
157139 SrcList *pTabList, /* The FROM clause */
157148 /* If there is more than one table or sub-select in the FROM clause of
157373 const SrcItem *pSrc, /* The FROM clause term to get the next index */
157397 SrcItem *pTabItem; /* FROM clause term being indexed */
157607 WhereLevel *pLevel, /* Make a Bloom filter for this FROM term */
157721 SrcItem *pSrc, /* The FROM clause term that is the vtab */
158209 ** SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?;
158318 ** ... FROM t1 WHERE a > ? AND a < ? ...
158331 ** ... FROM t1 WHERE a = ? AND b > ? AND b < ? ...
158336 ** ... FROM t1 WHERE a > ? AND a < ? ...
159336 SrcItem *pSrc, /* FROM clause term being analyzed */
159914 ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans.
159933 SrcList *pTabList; /* The FROM clause */
159934 SrcItem *pSrc; /* The FROM clause btree term to add */
159977 ** NOT INDEXED qualifier is omitted from the FROM clause */
160525 ** mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause
160526 ** entries that occur before the virtual table in the FROM clause and are
160528 ** mUnusable mask contains all FROM clause entries that occur after the
160534 ** ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6;
160554 SrcItem *pSrc; /* The FROM clause term to search */
160838 /* Add prerequisites to prevent reordering of FROM clause terms
160844 ** prevent FROM-clause terms from moving from the right side of
161250 ** SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1
161251 ** SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0
161404 /* If nLoop is zero, then there are no FROM terms in the query. Since
161887 ** SELECT v1, v3 FROM t1
161893 ** SELECT DISTINCT v1, v3 FROM t1
162041 SrcItem *pTabItem /* The FROM clause entry for the table */
162093 ** the FROM clause of a select. (INSERT and UPDATE statements are the
162094 ** same as a SELECT with only a single table in the FROM clause.) For
162097 ** SELECT * FROM t1, t2, t3 WHERE ...;
162110 ** appear in the FROM clause if a different order is better able to make
162173 SrcList *pTabList, /* FROM clause: A list of all tables to be scanned */
162213 /* The number of tables in the FROM clause is limited by the number of
162281 /* Special case: No FROM clause
162292 /* Assign a bit from the bitmask to every term in the FROM clause.
162294 ** The N-th term of the FROM clause is assigned a bitmask of 1<<N.
162338 ** FROM ... WHERE random()>0; -- eval random() once per row
162339 ** FROM ... WHERE (SELECT random())>0; -- eval random() once overall
163156 ** SELECT a+1, max(b) OVER (PARTITION BY c ORDER BY d) FROM t1 ORDER BY e;
163160 ** SELECT a+1, max(b) OVER (PARTITION BY c ORDER BY d) FROM (
163161 ** SELECT a, e, c, d, b FROM t1 ORDER BY c, d
163169 ** * FROM, WHERE, GROUP BY and HAVING clauses are all moved to
163185 ** FROM t1;
163191 ** FROM t1;
163195 ** SELECT max(b) OVER (PARTITION BY c ORDER BY d) FROM (
163196 ** SELECT e, min(e) OVER (PARTITION BY a ORDER BY b), c, d, b FROM
163197 ** SELECT a, e, c, d, b FROM t1 ORDER BY a, b
164051 ** When rewriting a query, if the new subquery in the FROM clause
164185 ** selected (e.g. "SELECT row_number() OVER () FROM t1"), it is possible
164199 ("New window-function subquery in FROM clause of (%u/%p)\n",
167596 0, /* FROM => nothing */
167869 /* 142 */ "FROM",
168159 /* 106 */ "from ::= FROM seltablist",
168203 /* 150 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret",
168262 /* 209 */ "expr ::= expr IS NOT DISTINCT FROM expr",
168263 /* 210 */ "expr ::= expr IS DISTINCT FROM expr",
168328 /* 275 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
169070 245, /* (106) from ::= FROM seltablist */
169114 190, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
169173 217, /* (209) expr ::= expr IS NOT DISTINCT FROM expr */
169174 217, /* (210) expr ::= expr IS DISTINCT FROM expr */
169239 291, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
169480 -2, /* (106) from ::= FROM seltablist */
169524 -6, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
169583 -6, /* (209) expr ::= expr IS NOT DISTINCT FROM expr */
169584 -5, /* (210) expr ::= expr IS DISTINCT FROM expr */
169649 -6, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
170247 case 106: /* from ::= FROM seltablist */
170433 case 150: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
170706 case 209: /* expr ::= expr IS NOT DISTINCT FROM expr */
170712 case 210: /* expr ::= expr IS DISTINCT FROM expr */
170995 case 275: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
172081 ** 92: FROM ALWAYS
172264 testcase( i==123 ); /* FROM */
179640 ** SELECT docid FROM ex1 WHERE b MATCH 'one two three';
180506 ** Return a list of comma separated SQL expressions and a FROM clause that
180509 ** SELECT <list of expressions> FROM %_content AS x ...
180518 ** "docid, unzip(x.'a'), unzip(x.'b'), unzip(x.'c') FROM %_content AS x"
180557 fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x",
180751 zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", zDb, zTbl);
181448 ** "SELECT <columns> FROM %_content WHERE rowid = ?"
183416 ** SELECT optimize(t) FROM t LIMIT 1;
190181 /* 0 */ "DELETE FROM %Q.'%q_content' WHERE rowid = ?",
190182 /* 1 */ "SELECT NOT EXISTS(SELECT docid FROM %Q.'%q_content' WHERE rowid!=?)",
190183 /* 2 */ "DELETE FROM %Q.'%q_content'",
190184 /* 3 */ "DELETE FROM %Q.'%q_segments'",
190185 /* 4 */ "DELETE FROM %Q.'%q_segdir'",
190186 /* 5 */ "DELETE FROM %Q.'%q_docsize'",
190187 /* 6 */ "DELETE FROM %Q.'%q_stat'",
190189 /* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1",
190191 /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)",
190196 "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC",
190198 "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?"
190201 /* 14 */ "SELECT count(*) FROM %Q.'%q_segdir' WHERE level = ?",
190202 /* 15 */ "SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?",
190204 /* 16 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ?",
190205 /* 17 */ "DELETE FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ?",
190207 /* 19 */ "DELETE FROM %Q.'%q_docsize' WHERE docid = ?",
190209 /* 21 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?",
190210 /* 22 */ "SELECT value FROM %Q.'%q_stat' WHERE id=?",
190215 /* 26 */ "DELETE FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?",
190216 /* 27 */ "SELECT ? UNION SELECT level / (1024 * ?) FROM %Q.'%q_segdir'",
190223 /* 28 */ "SELECT level, count(*) AS cnt FROM %Q.'%q_segdir' "
190231 " FROM (SELECT * FROM %Q.'%q_segdir' "
190237 /* 30 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?",
190248 "FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?",
190259 /* 34 */ "SELECT 1 FROM %Q.'%q_segments' WHERE blockid=? AND block IS NULL",
190263 /* 35 */ "SELECT idx FROM %Q.'%q_segdir' WHERE level=? ORDER BY 1 ASC",
190267 /* 36 */ "SELECT max( level %% 1024 ) FROM %Q.'%q_segdir'",
190271 "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? "
190499 /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */
190508 /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */
191004 ** SELECT max(idx) FROM %_segdir WHERE level = :iLevel
192366 ** SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?
192394 ** SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?
194388 ** DELETE FROM %_segdir WHERE level = :iAbsLevel AND idx = :iIdx
204132 zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", pRtree->zDb, pRtree->zName);
204382 const char *zFmt = "SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'";
204466 "DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1",
204469 "SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1",
204471 "DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1",
204474 "SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1",
204476 "DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1"
204545 "SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1",
204638 "SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1",
204803 ** SELECT rtreenode(2, data) FROM rt_node;
204856 ** SELECT rtreedepth(data) FROM rt_node WHERE nodeno=1;
204986 "SELECT data FROM %Q.'%q_node' WHERE nodeno=?",
205034 "SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1",
205035 "SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1"
205189 pCount = rtreeCheckPrepare(pCheck, "SELECT count(*) FROM %Q.'%q%s'",
205237 pStmt = rtreeCheckPrepare(&check, "SELECT * FROM %Q.'%q_rowid'", zDb, zTab);
205248 pStmt = rtreeCheckPrepare(&check, "SELECT * FROM %Q.%Q", zDb, zTab);
209796 "FROM sqlite_schema "
209805 " FROM main.sqlite_schema "
210002 ** 0) SELECT count(*) FROM sqlite_schema where name=%Q AND IsVirtual(%Q)
210004 ** 2) SELECT count(*) FROM sqlite_schema where name=%Q
210018 " FROM sqlite_schema"
210041 "SELECT rootpage FROM sqlite_schema WHERE name = %Q", zIdx
210162 sqlite3_mprintf("SELECT * FROM '%q'", pIter->zDataTbl)
210321 "SELECT max(_rowid_) FROM \"%s%w\"", zWrite, pIter->zTbl
210337 "SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1",
210435 sqlite3_mprintf("SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1",
210662 "_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)", zList
210863 "SELECT name FROM sqlite_schema WHERE rootpage = ?"
211036 "SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?"
211183 sqlite3_mprintf("DELETE FROM \"rbu_imp_%w\" WHERE %s", zTbl, zWhere)
211201 "SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s",
211213 "SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s",
211219 "SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s "
211221 "SELECT %s, rbu_control FROM '%q' "
211279 "DELETE FROM \"%s%w\" WHERE %s", zWrite, zTbl, zWhere
211293 "SELECT *%s FROM '%q' WHERE 0;"
211359 "SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s",
211511 sqlite3_mprintf("SELECT k, v FROM %s.rbu_state", p->zStateDb)
211624 "SELECT count(*) FROM stat.sqlite_schema"
211728 rbuMPrintfExec(p, p->dbMain, "SELECT * FROM sqlite_schema");
211821 p->rc = sqlite3_exec(p->dbMain, "SELECT * FROM sqlite_schema", 0, 0, 0);
212204 ** SELECT <cols>, rbu_control, rbu_rowid FROM ....
212417 "SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0"
212432 "SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL"
212483 "DELETE FROM %s.'rbu_tmp_%q'", p->zStateDb, pIter->zDataTbl
212701 sqlite3_mprintf("SELECT count(*) FROM sqlite_schema "
212752 "SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'"
212765 "FROM rbu_count"
213048 int rc2 = sqlite3_exec(p->dbRbu, "DELETE FROM stat.rbu_state", 0, 0, 0);
214956 "SELECT * FROM ("
214960 " FROM \"%w\".sqlite_schema WHERE rootpage!=0)",
215109 ** SELECT data FROM sqlite_dbpage('aux1') WHERE pgno=123;
217173 "SELECT * FROM \"%w\".\"%w\" WHERE NOT EXISTS ("
217174 " SELECT 1 FROM \"%w\".\"%w\" WHERE %s"
217227 "SELECT * FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)",
217902 ** SELECT * FROM zDb.zTab WHERE pk1 = ? AND pk2 = ? AND ...
217919 "SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND "
217928 sessionAppendStr(&buf, "SELECT * FROM ", &rc);
219473 ** DELETE FROM x WHERE a = :1 AND c = :3 AND (:5 OR b IS :2 AND d IS :4)
219493 sessionAppendStr(&buf, "DELETE FROM main.", &rc);
219542 ** SELECT * FROM x WHERE a = ?1 AND c = ?3
219616 "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS "
221492 ** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid
221554 ** SELECT count(*) FROM ftstable;
222571 #define FTS5_STMT_SCAN_ASC 0 /* SELECT rowid, * FROM ... ORDER BY 1 ASC */
222572 #define FTS5_STMT_SCAN_DESC 1 /* SELECT rowid, * FROM ... ORDER BY 1 DESC */
222573 #define FTS5_STMT_LOOKUP 2 /* SELECT rowid, * FROM ... WHERE rowid=? */
226322 const char *zSelect = "SELECT k, v FROM %Q.'%q_config'";
230302 sqlite3_stmt *pDeleter; /* "DELETE FROM %_data ... id>=? AND id<=?" */
230304 sqlite3_stmt *pIdxDeleter; /* "DELETE FROM %_idx WHERE segid=?" */
230773 ** DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast
230781 "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?",
230803 "DELETE FROM '%q'.'%q_idx' WHERE segid=?",
232417 "SELECT pgno FROM '%q'.'%q_idx' WHERE "
236099 "SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d "
236960 ** SELECT rowid, <fts> FROM <fts> ORDER BY +rank;
237836 "SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s",
239828 "SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC",
239829 "SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC",
239830 "SELECT %s FROM %s T WHERE T.%Q=?", /* LOOKUP */
239834 "DELETE FROM %Q.'%q_content' WHERE id=?", /* DELETE_CONTENT */
239836 "DELETE FROM %Q.'%q_docsize' WHERE id=?", /* DELETE_DOCSIZE */
239838 "SELECT sz FROM %Q.'%q_docsize' WHERE id=?", /* LOOKUP_DOCSIZE */
239841 "SELECT %s FROM %s AS T", /* SCAN */
240333 "DELETE FROM %Q.'%q_data';"
240334 "DELETE FROM %Q.'%q_idx';",
240340 "DELETE FROM %Q.'%q_docsize';",
240536 zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'",
243808 "SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'",
244283 ** SELECT * FROM stmt;
246132 sql = sqlite3_mprintf("SELECT 'CREATE TABLE %s.' || substr(sql,14) FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence' AND rootpage>0;", dbName);
246142 sql = sqlite3_mprintf("SELECT 'CREATE INDEX %s.' || substr(sql,14) FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %%';", dbName);
246152 sql = sqlite3_mprintf("SELECT 'CREATE UNIQUE INDEX %s.' || substr(sql,21) FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %%';", dbName);
246162 sql = sqlite3_mprintf("SELECT 'INSERT INTO %s.' || quote(name) || ' SELECT * FROM main.' || quote(name) || ';' FROM main.sqlite_master WHERE type = 'table' AND name!='sqlite_sequence' AND rootpage>0;", dbName);
246172 sql = sqlite3_mprintf("SELECT 'DELETE FROM %s.' || quote(name) || ';' FROM %s.sqlite_master WHERE name='sqlite_sequence';", dbName, dbName);
246182 sql = sqlite3_mprintf("SELECT 'INSERT INTO %s.' || quote(name) || ' SELECT * FROM main.' || quote(name) || ';' FROM %s.sqlite_master WHERE name=='sqlite_sequence';", dbName, dbName);
246192 sql = sqlite3_mprintf("INSERT INTO %s.sqlite_master SELECT type, name, tbl_name, rootpage, sql FROM main.sqlite_master WHERE type='view' OR type='trigger' OR (type='table' AND rootpage=0);", dbName, dbName);