title: How do I store intermediate data and share it between SQL queries?
body: <p>Let's say I have four table (A,B,C,D), <code>empId</code> is common in all.  </p>
  
  <p>After running some complex query I get list of eligible <code>empIds</code>.  </p>
  
  <p>Now I need to run <code>Select .... from ..... where empId IN LIST</code>.  </p>
  
  <p>I want to store this list of <code>empIds</code> in some variable so that I don't have run complex query every time to get list of <code>empIds</code>.  </p>
  
  <p>Is there anyway to store <code>empIds</code> in some temporary space?</p>
  
  <p>This way I can cut down in running this complex query every time.  </p>