title: Oracle SQL Hierarchical query bottom to top
body: <p>I have ids of leafs. I need to select all id in hierarchy. Now i'm using following query:       </p>
  
  <pre><code>select distinct id 
  from table
  start with id in (IDS_OF_LEAFS)
  connect by id = prior pid
  </code></pre>
  
  <p>But maybe it can be done another way without distinct and traversal full hierarchy?</p>