title: Query to get hierarchy from a table in Sybase
body: <p>I have a table with following structure:</p>
  
  <blockquote>
  <pre><code>Emp Rel_Emp relation
  A   B       1
  A   C       1
  B   D       1
  B   A       0
  ....
  </code></pre>
  </blockquote>
  
  <p>In above table if "Rel_Emp" is child then relation is "1" if its parent then relation is "0".  I need to write a query to get the parent child hierarchy [There can be multiple trees in table].</p>
  
  <p>I know how to achieve this in oracle [by using "connect by prior" clause] but i need to do this in sybase.
  Can someone please guide me.</p>
  
  <p>P.S: I have always worked in oracle and dont have much idea about sybase</p>