title: Multiple linked list with SQLAlchemy and MySQL
body: <p>I want to have multiple linked list in a SQL table, using MySQL and SQLAlchemy (0.7). All lists with it's first node with parent being 0, and ends with child being 0. The id represents the list, and not the indevidiual element. The element is identified by PK</p>
  
  <p>With some omitted syntax (not relevant to the problem) it should look something like this:</p>
  
  <pre><code>id(INT, PK)
  content (TEXT)
  parent(INT, FK(id), PK)
  child(INT, FK(id), PK)
  </code></pre>
  
  <p>As the table has multiple linked lists how can return the entire list from the database I select a specific ID and parent is 0?</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT * FROM ... WHERE id = 3 AND parent = 0   
  </code></pre>