title: Get distinct result from ordered result of subquery in oracle
body: <p>We are working with oracle database. I need result in sorted order. So I have created a query that sort on id first then I have applied query over subquery result to get distinct para.</p>
  
  <p>Query is :</p>
  
  <pre><code>select distinct(para) 
  from (
      select para, id 
      from book 
      where title='2' 
        and chapter_id='2' 
        and subchap='1' 
        and para is not null 
      order by id) 
  order by para
  </code></pre>
  
  <p>This return list as :</p>
  
  <pre><code>a
  aa
  aaa
  bb
  c
  d
  dd
  </code></pre>
  
  <p>But I want this list as :</p>
  
  <pre><code>a
  c
  d
  aa
  bb
  dd
  aaa
  </code></pre>
  
  <p>I want list of distinct para list? How can I achieve this using oracle query?</p>