title: Oracle pl/sql order by case
body: <p>I need to arrange the below data in a particular format</p>
  
  <pre><code>Code    Qty
  R   200
  R   0
  A   100
  A   0
  </code></pre>
  
  <p>Required Output Format</p>
  
  <pre><code> Active (A) with stock (Qty &gt; 0)
   Reserve (R) with stock (Qty &gt; 0)
   Active (A) without stock (Qty = 0)
   Reserve (R) without stock  (Qty = 0)
  </code></pre>
  
  <p>In above case</p>
  
  <pre><code>A 100
  R 200
  A 0
  R 0
  </code></pre>
  
  <p>Please help me on this guys. i tried using case in order by but couldnt eventually figure out the answer.</p>