44
44
<script type="text/javascript" src="_static/doctools.js"></script>
45
45
<!-- end iterate through sphinx environment script_files -->
47
<script type="text/javascript" src="_static/detectmobile.js"></script>
47
48
<script type="text/javascript" src="_static/init.js"></script>
48
49
<link rel="index" title="Index" href="genindex.html" />
49
50
<link rel="search" title="Search" href="search.html" />
69
71
<div id="docs-container">
77
<div id="docs-top-navigation-container" class="body-background">
74
78
<div id="docs-header">
79
<div id="docs-version-header">
80
Release: <span class="version-num">0.9.6</span> | Release Date: June 23, 2014
75
83
<h1>SQLAlchemy 0.9 Documentation</h1>
77
<div id="docs-search">
79
<form class="search" action="search.html" method="get">
80
<input type="text" name="q" size="18" /> <input type="submit" value="Search" />
81
<input type="hidden" name="check_keywords" value="yes" />
82
<input type="hidden" name="area" value="default" />
86
<div id="docs-version-header">
87
Release: <span class="version-num">0.9.4</span> | Release Date: March 28, 2014
94
<div id="docs-top-navigation">
95
<div id="docs-top-page-control" class="docs-navigation-links">
88
<div id="docs-body-container">
90
<div id="fixed-sidebar" class="withsidebar">
93
<div id="docs-sidebar-popout">
94
<h3><a href="index.html">SQLAlchemy 0.9 Documentation</a></h3>
96
<p id="sidebar-paginate">
97
<a href="index.html" title="SQLAlchemy 0.9 Documentation">Up</a> |
101
<p id="sidebar-topnav">
102
<a href="index.html">Contents</a> |
103
<a href="genindex.html">Index</a>
106
<div id="sidebar-search">
107
<form class="search" action="search.html" method="get">
108
<input type="text" name="q" size="12" /> <input type="submit" value="Search" />
109
<input type="hidden" name="check_keywords" value="yes" />
110
<input type="hidden" name="area" value="default" />
116
<div id="docs-sidebar">
99
<a href="contents.html">Table of Contents</a> |
100
<a href="genindex.html">Index</a>
101
| <a href="_sources/glossary.txt">view source
106
<div id="docs-navigation-banner">
107
<a href="index.html">SQLAlchemy 0.9 Documentation</a>
121
<div id="docs-body-container">
123
<div id="docs-sidebar">
124
<h3><a href="index.html">Table of Contents</a></h3>
126
123
<li><a class="reference internal" href="#">Glossary</a></li>
132
<h4>Quick Search</h4>
134
<form class="search" action="search.html" method="get">
135
<input type="text" name="q" size="18" /> <input type="submit" value="Search" />
136
<input type="hidden" name="check_keywords" value="yes" />
137
<input type="hidden" name="area" value="default" />
143
135
<div id="docs-body" class="withsidebar" >
145
137
<div class="section" id="glossary">
374
366
<p>The above subquery refers to the <tt class="docutils literal"><span class="pre">user_account</span></tt> table, which is not itself
375
367
in the <tt class="docutils literal"><span class="pre">FROM</span></tt> clause of this nested query. Instead, the <tt class="docutils literal"><span class="pre">user_account</span></tt>
376
table is recieved from the enclosing query, where each row selected from
368
table is received from the enclosing query, where each row selected from
377
369
<tt class="docutils literal"><span class="pre">user_account</span></tt> results in a distinct execution of the subquery.</p>
378
370
<p>A correlated subquery is in most cases present in the <a class="reference internal" href="#term-where-clause"><em class="xref std std-term">WHERE clause</em></a>
379
371
or <a class="reference internal" href="#term-columns-clause"><em class="xref std std-term">columns clause</em></a> of the immediately enclosing <tt class="docutils literal"><span class="pre">SELECT</span></tt>
994
986
<p>A subquery comes in two general flavors, one known as a “scalar select”
995
987
which specifically must return exactly one row and one column, and the
996
988
other form which acts as a “derived table” and serves as a source of
997
rows for the FROM clause of another select. A scalar select is eligble
989
rows for the FROM clause of another select. A scalar select is eligible
998
990
to be placed in the <a class="reference internal" href="#term-where-clause"><em class="xref std std-term">WHERE clause</em></a>, <a class="reference internal" href="#term-columns-clause"><em class="xref std std-term">columns clause</em></a>,
999
991
ORDER BY clause or HAVING clause of the enclosing select, whereas the
1000
992
derived table form is eligible to be placed in the FROM clause of the