title: Can I select before join?
body: <p>I want to <code>left join</code> two tables. My problem is that the table from the "right" does not exist in the database. I need to create it during the query. In more details, the "right" table is obtained by extraction (<code>select ... where ...</code>) of certain rows from an existing table.</p>
  
  <p>I thought that the solution would be to <code>join</code> first and then to <code>select</code>. I thought that it will be just slower than <code>elect</code> and <code>join</code> but than I realized that it will not work at all.</p>
  
  <p>For example:</p>
  
  <p>Left table:</p>
  
  <pre><code>| Dog | 1 |
  | Cat | 0 |
  </code></pre>
  
  <p>Right table:</p>
  
  <pre><code>| Dog | Paul | yes |
  | Cat | Carin | no |
  </code></pre>
  
  <p>I want to use only those rows from the second table where the second column has "Carin". So, if I join after selection of those rows I get:</p>
  
  <pre><code>| Dog | 1 | Null | Null|
  | Cat | 0 | Carin | no |
  </code></pre>
  
  <p>But if I first join, I get:</p>
  
  <pre><code>| Dog | 1 | Paul | yes |
  | Cat | 0 | Carin | no |
  </code></pre>
  
  <p>And then if I select rows with Carin I get:</p>
  
  <pre><code>| Cat | 0 | Carin | no |
  </code></pre>
  
  <p>So, you see that result is different. In the first case I get 2 rows and in the second case I got just 1 row.</p>
  
  <p>So, is it possible to select before join?</p>