Lines Matching full:subquery
3884 ** subquery and is not a column value, then all of these functions return
3917 ** expression or subquery) then the declared type of the table
3919 ** expression or subquery, then a NULL pointer is returned.
10521 ** If the expression is a subquery then Expr.iColumn holds an integer
10522 ** register number containing the result of the subquery. If the
10523 ** subquery gives a constant result, then iTable is -1. If the subquery
10525 ** then iTable is the address of a subroutine that computes the subquery.
10723 ** Each table or subquery in the FROM clause is a separate element of
10749 int addrFillSub; /* Address of subroutine to manifest a subquery */
10904 ** Each subquery gets a new NameContext. The pNext field points to the
10918 int nDepth; /* Depth of subquery recursion. 1 for no recursion */
73121 ** callback on p, but do invoke it on each FROM clause subquery
74118 ** already expanded this SELECT. However, if this is a subquery within
75759 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
75822 ** is a correlated subquery) then the value of the allocated register is
75823 ** reset to NULL each time the subquery is rerun. This allows the
75951 ** Generate code for scalar subqueries used as a subquery expression, EXISTS,
75954 ** (SELECT a FROM b) -- subquery
75955 ** EXISTS (SELECT a FROM b) -- EXISTS subquery
75957 ** x IN (SELECT a FROM b) -- IN operator with subquery on the right
75960 ** operator or subquery.
75976 ** If rMayHaveNull is zero, that means that the subquery is being used
75999 ** * The right-hand side is a correlated subquery
76013 pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ",
76157 VdbeComment((v, "Init subquery result"));
81095 /* An attempt to read a column out of a subquery or other
84510 ** alias token. If the term is a subquery, then pSubquery is the
84511 ** SELECT statement that the subquery encodes. The pTable and
84524 Select *pSubquery, /* A subquery used in place of a table name */
90607 return 0; /* FROM clause cannot contain a subquery */
95354 int iSub1, /* Subquery id 1 */
95355 int iSub2, /* Subquery id 2 */
95522 ** database table or a subquery.
97018 ** This routine is part of the flattening procedure. A subquery
97023 ** of the subquery rather the result set of the subquery.
97106 ** subquery first and store the results in a temporary table, then
97124 ** (1) The subquery and the outer query do not both use aggregates.
97126 ** (2) The subquery is not an aggregate or the outer query is not a join.
97128 ** (3) The subquery is not the right operand of a left outer join
97131 ** (4) The subquery is not DISTINCT.
97137 ** (6) The subquery does not use aggregates or the outer query is not
97140 ** (7) The subquery has a FROM clause. TODO: For subqueries without
97145 ** (8) The subquery does not use LIMIT or the outer query is not a join.
97147 ** (9) The subquery does not use LIMIT or the outer query does not use
97150 ** (10) The subquery does not use aggregates or the outer query does not
97153 ** (11) The subquery and the outer query do not both have ORDER BY clauses.
97158 ** (13) The subquery and outer query do not both use LIMIT.
97160 ** (14) The subquery does not use OFFSET.
97163 ** subquery does not have a LIMIT clause.
97166 ** (16) The outer query is not an aggregate or the subquery does
97180 ** LIMIT and OFFSET clauses. The subquery cannot use any compound
97189 ** (19) The subquery does not use LIMIT or the outer query does not
97198 ** (21) The subquery does not use LIMIT or the outer query is not
97202 ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
97203 ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
97209 ** the subquery before this routine runs.
97214 int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
97216 int subqueryIsAgg /* True if the subquery uses aggregate functions */
97220 Select *pSub; /* The inner query or "subquery" */
97223 SrcList *pSubSrc; /* The FROM clause of the subquery */
97228 struct SrcList_item *pSubitem; /* The subquery */
97274 ** Restriction 3: If the subquery is a join, make sure the subquery is
97287 ** Restriction 12: If the subquery is the right operand of a left outer
97288 ** join, make sure the subquery has no WHERE clause.
97303 ** subquery is the right term of a LEFT JOIN, then do not flatten.
97345 /* Authorize the subquery */
97381 ** We call this the "compound-subquery flattening".
97414 ** subquery
97425 ** subquery until code generation is
97427 ** refer to the subquery even after flattening. Ticket #3346.
97443 /* The following loop runs once for each term in a compound-subquery
97445 ** of flattening - a flattening other than a compound-subquery flattening -
97448 ** This loop moves all of the FROM elements of the subquery into the
97453 ** those references with expressions that resolve to the subquery FROM
97459 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
97460 nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */
97475 /* The subquery uses a single slot of the FROM clause of the outer
97476 ** query. If the subquery has more than one element in its FROM clause,
97478 ** of the subquery.
97485 ** outer query (the middle slot) is used by the subquery. The next
97488 ** two elements in the FROM clause of the subquery.
97497 /* Transfer the FROM clause terms from the subquery into the
97507 /* Now begin substituting subquery result set expressions for
97513 ** \ \_____________ subquery __________/ /
97576 /* Finially, delete what is left of the subquery and return
97724 ** an entry of the FROM clause is a subquery instead of a table or view,
97725 ** then create a transient table structure to describe the subquery.
97926 ** subquery in the parser tree.
97960 ** For each FROM-clause subquery, add Column.zType and Column.zColl
97962 ** of that subquery.
98350 /* This subquery can be absorbed into its parent. */
98358 ** the content of this subquery. pItem->addrFillSub will point
98371 /* If the subquery is no correlated and if we are not inside of
98372 ** a trigger, then we only need to compute the value of the subquery
103043 ** (expression-list) column IN (subquery) column IS NULL
106276 zMsg = sqlite3MAppendf(db, zMsg, "%s SUBQUERY %d", zMsg,pItem->iSelectId);