title: oracle query to find matches in two tables
body: <p>two tables in database, similar structure below.</p>
  
  <p>-I need the list of elements from TABLE1 where P1 matches S3 and at the same time P2 matches S2.</p>
  
  <pre><code>+            TABLE1           +        +           TABLE2            +
  +---------+---------+---------+        +---------+---------+---------+
  | P1      | P2      | P3      |        + S1      | S2      | S3      |
  +---------+---------+---------+        +---------+---------+---------+
  | A       | B       | C       |        | P       | B       | A       |
  | B       | B       | C       |        | A       | G       | T       |
  | Z       | K       | R       |        | T       | M       | T       |
  | T       | S       | L       |        | M       | K       | Z       |
  | W       | W       | W       |        | W       | W       | W       |
  +---------+---------+---------+        +---------+---------+---------+
  </code></pre>
  
  <p>so, as a result I shall get:</p>
  
  <pre><code>+            RESULT           +
  +---------+---------+---------+
  | P1      | P2      | P3      |
  +---------+---------+---------+
  | A       | B       | C       |
  | Z       | K       | R       |
  | W       | W       | W       |
  +---------+---------+---------+
  </code></pre>
  
  <p>the question : what is the oracle query that does this join, compare and match operations.
  Note: using a loop is discouraged. </p>
  
  <p>Thanks in advance...</p>