title: Mysql Query to fetch data of shared posts
body: <p>DB Schema is given below. how can i fetch posts plus shared posts of users like Facebook. in Facebook wall the we can see original posts and the posts user shared. how can i actively get the posts. records could be in millions. 
  i have tried using joining two tables but i am unable to identify the shared posts.</p>
  
  <pre><code>SELECT *
  FROM
      post_shares
      INNER JOIN posts 
          ON (post_shares.post_id = posts.id);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Pg2B9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pg2B9.png" alt="DB Schema"></a></p>