SQL>CREATE TABLE testtab ( SQL& label VARCHAR(30) PRIMARY KEY, SQL& a VARCHAR(10), SQL& b VARCHAR(10) SQL&); SQL>INSERT INTO testtab VALUES('both null',NULL,NULL); SQL>INSERT INTO testtab VALUES('a null',NULL,'b not null'); SQL>INSERT INTO testtab VALUES('b empty string','a',''); SQL>INSERT INTO testtab VALUES('a null, b empty string',NULL,''); SQL>INSERT INTO testtab VALUES('equal non-empty strings','x','x'); SQL>INSERT INTO testtab VALUES('non-equal non-empty strings','x','y'); SQL>SELECT * FROM testtab; LABEL A B ============================== ========== ========== a null - b not null a null, b empty string - b empty string a both null - - equal non-empty strings x x non-equal non-empty strings x y 6 rows found SQL>SELECT * FROM testtab WHERE a=b; LABEL A B ============================== ========== ========== equal non-empty strings x x 1 row found SQL>SELECT * FROM testtab WHERE a<>b; LABEL A B ============================== ========== ========== b empty string a non-equal non-empty strings x y 2 rows found SQL>SELECT * FROM testtab WHERE b IS NULL; LABEL A B ============================== ========== ========== both null - - 1 row found SQL>SELECT * FROM testtab WHERE b IS NOT NULL; LABEL A B ============================== ========== ========== a null - b not null a null, b empty string - b empty string a equal non-empty strings x x non-equal non-empty strings x y 5 rows found