For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
select To_Char(ename) from emp1 MINUS select To_Char(ename) from emp2
SQL> create table emp1 as select to_clob(ename) ename,deptno from emp 2 / Table created. SQL> create table emp2 as select to_clob(ename) ename,deptno from emp where deptno = 20 2 / Table created. SQL> select * from emp1 2 minus 3 select * from emp2 4 / select * from emp1 * ERROR at line 1: ORA-00932: inconsistent datatypes: expected - got CLOB with t1 as ( select emp1.*, rownum rn from emp1 ), t2 as ( select rn from t1, emp2 where dbms_lob.compare(t1.ename,emp2.ename) = 0 ), t3 as ( select * from t1 where rn not in (select rn from t2) ), t4 as ( select ename, deptno, rownum rn from t3 ), t5 as ( select t41.rn from t4 t41, t4 t42 where dbms_lob.compare(t41.ename,t42.ename) = 0 and t41.rn != t42.rn ) select ename, deptno from t4 where rn not in (select rn from t5) / ENAME DEPTNO -------------------------------------------------------------------------------- ---------- ALLEN 30 WARD 30 MARTIN 30 BLAKE 30 CLARK 10 KING 10 TURNER 30 JAMES 30 MILLER 10 9 rows selected.