title: ORA-00932 (inconsistent datatypes: expected - got CLOB) error that I do not understand
body: <p>I started out with a query as such:</p>
  
  <pre><code>    SELECT A.*
        FROM TABLE_A A
  INNER JOIN TABLE_B B
          ON A.YEAR = B.YEAR
       WHERE A.ID IN (SELECT ID FROM TABLE_B)
  </code></pre>
  
  <p>The above query gave me duplicate records, so I added the <code>DISTINCT</code> keyword as such:</p>
  
  <pre><code>    SELECT DISTINCT A.*
        FROM TABLE_A A
  INNER JOIN TABLE_B B
          ON A.YEAR = B.YEAR
       WHERE A.ID IN (SELECT ID FROM TABLE_B)
  </code></pre>
  
  <p>This second query gave me the following error:</p>
  
  <blockquote>
    <p>ORA-00932: inconsistent datatypes: expected - got CLOB</p>
    
    <ol start="932">
    <li>00000 -  "inconsistent datatypes: expected %s got %s"</li>
    </ol>
  </blockquote>
  
  <p>I finally corrected the query and eliminated the duplicate records by moving the condition in the <code>WHERE</code> clause to the <code>INNER JOIN</code> like this:</p>
  
  <pre><code>    SELECT A.*
        FROM TABLE_A A
  INNER JOIN TABLE_B B
          ON A.YEAR = B.YEAR
         AND A.ID = B.ID
  </code></pre>
  
  <p>I just don't understand why the second query did not work. Why does adding the <code>DISTINCT</code> keyword here suddenly cause an issue?</p>