title: Save the intermediate result of SQL query
body: <p>I am wondering if there is any way to save the intermediate result or tables in SQL. For example assume you have two different SQL statements that in the first statement you join two tables, then you want to see how many rows the resulting table has. I know there are many ways to do this but I am interested in seeing how this can be done sequentially. Consider the following example:</p>
  <pre><code>select * from order_table left join customer_table on order_table.id = customer_table.id
  </code></pre>
  <p>Then I want to see count of number of rows (as an easy example)</p>
  <pre><code>select count(*) from table 
  </code></pre>
  <p>But I do not know what this table should be. How may I save the result of above query in some logical table or how to refer to what was created before in SQL.</p>