title: SQL Query - aliasing + different periods + different tables
body: <p>I am using toad for oracle and I experienced different issues.</p>
  
  <p>Aliasing - When I want to use the same column twice?!<br>
  Let us asume that we have a table x which has col1, col2, col3.  Col1 contains a customer contact numbers (211,212,213, and more)</p>
  
  <p>And there is another table, <code>y</code>, that has col1,col4,col5.  Col1 in both tables are equal.  Col4 shows whether a number is main or secondary.</p>
  
  <p>Table <code>y</code></p>
  
  <pre><code>(Col1,col4,col5)
  (211,Main,v)
  (212,Secondary,s)
  (213,Secondary,w)
  </code></pre>
  
  <p>What I want to do is as follow :</p>
  
  <pre><code>SELECT col2, col1 as mainNumbet, col1 as secondNumber
    FROM x
   WHERE mainNumber IN (SELECT col1 
                          FROM y 
                         WHERE col4 = 'main')
     AND SecondNumber IN (SELECT col1 
                            FROM y 
                           WHERE col4 = "secondary")
  </code></pre>
  
  <p>But it states that there is a problem !??</p>