title: Using the result from a subquery elsewhere in the query
body: <p>I have the following pseudo-sqlite call:</p>
  
  <pre><code>SELECT x, y,
      (SELECT --very long SQL call--) AS z,
      (SELECT a FROM diff_table_name WHERE b = z) AS e
  FROM table_name
  WHERE c = d
  </code></pre>
  
  <p>Essentially I want to use the <code>z</code> variable result from the first <em>subquery</em> in the second <em>subquery</em>, but I get a </p>
  
  <blockquote>
    <p>no such column: z</p>
  </blockquote>
  
  <p>error when I do.  I can repeat the very long SQL call in the second <em>subquery</em> and that works, but I was hoping to not have to do that.  Or maybe there's a way to return both <code>a</code> and <code>z</code> from one <em>subquery</em>?</p>