title: SQL query: make a report for all products
body: <p>I need help to build SQL query.</p>
  
  <p>I have 2 tables table PROJECT and PRODUCT, which has this fields:</p>
  
  <p><strong>PROJECT:</strong></p>
  
  <ul>
  <li>PROJECTCODE</li>
  <li>PROJECTNAME</li>
  </ul>
  
  <p><strong>PRODUCT:</strong></p>
  
  <ul>
  <li>ITEMCODE</li>
  <li>ITEMNAME</li>
  <li>PROJECTCODE</li>
  <li>REPLACEDBYCODE</li>
  </ul>
  
  <p>The REPLACEDBYCODE will contain other ITEMCODE (meaning, this product has been replaced by other product). REPLACEDBYCODE will have value of blank '' if the product has NOT been replaced yet.</p>
  
  <p>I want to make a report for all products like this:</p>
  
  <pre><code>ITEMCODE | ITEMNAME | REPLACEDBYCODE | **REPLACED_ITEM_NAME** | PROJECTNAME
  </code></pre>