title: How to sort a same column both in asc order and desc order
body: <p>With an SQL Query how do we get the output of 2 columns, the first one being a column sorted in asc order and the second one with the order desc and both are same columns.</p>
  
  <p>ex:</p>
  
  <pre><code>emp table:
  empid
  1 
  5
  9
  4
  </code></pre>
  
  <p>The query output should be</p>
  
  <pre><code>empid_1   empid_2
  1          9
  4          5
  5          4
  9          1
  </code></pre>
  
  <p>What OP tried so far</p>
  
  <pre><code>WITH emp1 
       AS (SELECT ROWNUM a, 
                  empno 
           FROM   (SELECT empno 
                   FROM   emp 
                   ORDER  BY 1 ASC)), 
       emp2 
       AS (SELECT ROWNUM b, 
                  empno 
           FROM   (SELECT empno 
                   FROM   emp 
                   ORDER  BY 1 DESC)) 
  SELECT emp1.empno, 
         emp2.empno 
  FROM   emp1, 
         emp2 
  WHERE  emp1.a = emp2.b; 
  </code></pre>