title: Select loop of posts comments UPDATED Sql, Mysql
body: <p>I edited from my prior question...I was trying hard but I returned the results only by the main post id....Not using the last comment id (expected)</p>
  
  <p>So I want to get from the bottom to the top. not viceversa.</p>
  
  <p><strong>Posts</strong></p>
  
  <pre><code>id_post     |       post          | comment_of 
      25          main post               0 
      26          comment 1st level       25 
      27          comment 2nd level       26 
      28          another post            0 
      29          comment not related     14 
      30          comment 3rd level       27 
      31          comment not related     13 
  </code></pre>
  
  <p><strong>Query</strong> </p>
  
  <pre><code>    SELECT id_post, 
             post, 
             comment_of 
      FROM (SELECT * FROM posts 
      ORDER BY comment_of, id_post) posts_sorted, 
              (SELECT @pv := '25') initialisation 
      WHERE find_in_set(comment_of, @pv) 
      AND length(@pv := concat(@pv, ',', id_post)) 
      OR id_post=@pv 
  </code></pre>
  
  <p><strong>Result</strong> </p>
  
  <pre><code>id_post     |       post          | comment_of 
      25          main post               0 
      26          comment 1st level       25 
      27          comment 2nd level       26 
      30          comment 3rd level       27 
  </code></pre>
  
  <p>working fiddle  <a href="http://sqlfiddle.com/#!9/c07667/2" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/c07667/2</a></p>
  
  <p>I want to get the results <strong>by the last comment</strong>, Not by the main post....in this case I want to get the same result by choosing <code>30</code> (last comment). Not vice versa</p>