title: How to get the first element from a linked list in Oracle?
body: <p>I have a table in my Oracle-DB that looks like this:</p>
  
  <pre><code>╔════╦════════════════╦═════════════╗
  ║ ID ║ Predecessor_id ║ Information ║
  ╠════╬════════════════╬═════════════╣
  ║ 1  ║     NULL       ║    foo      ║
  ║ 2  ║     1          ║    bar      ║
  ║ 3  ║     2          ║    muh      ║
  ║ 4  ║     NULL       ║    what     ║
  ║ 5  ║     4          ║    ever     ║
  ╚════╩════════════════╩═════════════╝
  </code></pre>
  
  <p>I need a SELECT that returns something like this:</p>
  
  <pre><code>╔════╦════════════════╦════════════════════╦═════════════╗
  ║ ID ║ Predecessor_id ║ First_list_element ║ Information ║
  ╠════╬════════════════╬════════════════════╬═════════════╣
  ║ 1  ║     NULL       ║         1          ║    foo      ║
  ║ 2  ║     1          ║         1          ║    bar      ║
  ║ 3  ║     2          ║         1          ║    muh      ║
  ║ 4  ║     NULL       ║         4          ║    what     ║
  ║ 5  ║     4          ║         4          ║    ever     ║
  ╚════╩════════════════╩════════════════════╩═════════════╝
  </code></pre>
  
  <p>The table has some kind of linked list aspect. The first element of the List is the one with no predecessor. What I need is the information for every row in which List it is a member of. The list is defined by the ID of the first element.</p>
  
  <p>In a programming language I would implement some kind of lookup table. But in SQL I have no idea. I would prefer SQL but if only PL/SQL gives me a response I'll take that as well.</p>