Joined: 06 Jun 2008 Posts: 1173 Location: Atlanta, GA
Even for a non-DB2 person like me, the message is quite clear -- it wants FULL, LEFT, INNER, or RIGHT and you gave it EXCEPT. Fix the problem and proceed.
Your synax is wrong. Probably try the below one.
SELECT COUNT(*)
FROM
(
(
(SELECT * FROM t1 A)
EXCEPT
(SELECT * FROM t2 B)
) E
UNION ALL
(
(SELECT * FROM t2 C)
EXCEPT
(SELECT * FROM t1 D)
) F
) G;;
Please note that I have not tested the above query since I am not having DB2 9 in my system. EXCEPT is DB2 9 function.