inconsistent datatypes: expected - got CLOB for table join
<p>Oracle XE 11.  a very simple join query gave me the following error:</p>

<pre><code>ORA-00932: inconsistent datatypes: expected - got CLOB
</code></pre>

<p>Tables:</p>

<pre><code>Product
----------------------------------
id, name, description, categoryId 


Catetory
------------------
id, name
</code></pre>

<p>The product description is CLOB.</p>

<p>SQL> desc Product;</p>

<pre><code> Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER(19)
 NAME                                      NOT NULL VARCHAR2(30 CHAR)
 CATEGORYID                                         NUMBER(19)
 DESCRIPTION                                        CLOB
</code></pre>

<p>SQL> desc Category;</p>

<pre><code> Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER(19)
 NAME                                      NOT NULL VARCHAR2(30 CHAR)
</code></pre>

<p>Query:</p>

<pre><code>SELECT DISTINCT t1.ID, t1.DESCRIPTION, t1.NAME, t0.name FROM Product t1 
LEFT OUTER JOIN Category t0 ON (t0.ID = t1.categoryId);
</code></pre>

<p>ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got CLOB</p>

<p>IF I remove the t0.name from selection, it will work. weird.</p>

<pre><code>SELECT DISTINCT t1.ID, t1.DESCRIPTION, t1.NAME FROM Product t1 
LEFT OUTER JOIN Category t0 ON (t0.ID = t1.categoryId);
</code></pre>

<p>Thanks.</p>