title: How to fetch data from two different tables
body: <p>I'm trying to fetch data from two different tables, the thing 3 tables have in common is username field, here is what I've tried till now</p>
  
  <pre><code>SELECT 
      *
  FROM
      post f1
          INNER JOIN
      portfolio f2 ON f1.username = f2.username
  WHERE
      f1.username IN ('user1' , 'user2')
          OR f2.username IN ('user1' , 'user2');
  </code></pre>
  
  <p>All i want is if user1 has post data in <code>post</code> table &amp; portfolio data in <code>portfolio</code> table then fetch all those detail</p>
  
  <p>here is table structure</p>
  
  <p>Post table</p>
  
  <pre><code>-------------------------------------------
  | id  | username | content | title | time |
  -------------------------------------------
  |  1  |   user1  |   eg    | titl  | eg1  |
  |  2  |   user2  |   eg    | title | eg2  |
  |  3  |   user3  |   eg    | title | eg3  |
  |  4  |   user1  |   eg1   | title | eg4  |
  |  5  |   user5  |   eg    | title | eg5  |
  |  6  |   user6  |   eg    | title | eg6  |
  -------------------------------------------
  </code></pre>
  
  <p>Portfolio table</p>
  
  <pre><code>-------------------------------------------
  | id  | username |  Image  | title | time |
  -------------------------------------------
  |  1  |   user1  |   eg    | titl  | eg1  |
  |  2  |   user2  |   eg    | title | eg2  |
  |  3  |   user4  |   eg    | title | eg3  |
  |  4  |   user1  |   eg1   | title | eg4  |
  |  5  |   user3  |   eg    | title | eg5  |
  |  6  |   user6  |   eg    | title | eg6  |
  -------------------------------------------
  </code></pre>
  
  <p>some of these user has data in post table also &amp; portfolio table also so fetch the detail, how can i do it as my query is bringing duplicate data</p>