title: Joining a table to itself in Oracle
body: <p>Very confused by this one.</p>
  
  <p>I'm trying to join a table to itself. I have the following details:</p>
  
  <pre><code>PRODUCT NO           FORMAT NO             FORMAT CODE              NUMBER
  1000                 1111                  P                        0
  1000                 1112                  O                        0
  1000                 1113                  H                        546
  </code></pre>
  
  <p>I want to create a SELECT statement that outputs all the "O" format codes, but rather than outputting "0" in the "NUMBER" column, I want to output "546". It would look like this:</p>
  
  <pre><code>PRODUCT NO           FORMAT NO             FORMAT CODE              NUMBER
  1000                 1112                  O                        546
  </code></pre>
  
  <p>So I think here I'm effectively joining the table to itself? Just not sure how to do this...</p>
  
  <p>Thanks!</p>