troels@microsoft:windows> CREATE TABLE testtab ( label VARCHAR(30) PRIMARY KEY, a VARCHAR(10) NULL, b VARCHAR(10) NULL ); affected 0 rows (5 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('both null',NULL,NULL); affected 1 rows (5 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('a null',NULL,'b not null'); affected 1 rows (3 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('b empty string','a',''); affected 1 rows (3 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('a null, b empty string',NULL,''); affected 1 rows (2 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('equal non-empty strings','x','x'); affected 1 rows (1 msec) troels@microsoft:windows> INSERT INTO testtab VALUES('non-equal non-empty strings','x','y'); affected 1 rows (1 msec) troels@microsoft:windows> SELECT * FROM testtab; -----------------------------+--------+------------+ label | a | b | -----------------------------+--------+------------+ a null | [NULL] | b not null | a null, b empty string | [NULL] | | b empty string | a | | both null | [NULL] | [NULL] | equal non-empty strings | x | x | non-equal non-empty strings | x | y | -----------------------------+--------+------------+ 6 rows in result (first row: 81 msec; total: 84 msec) troels@microsoft:windows> SELECT * FROM testtab WHERE a=b; -------------------------+---+---+ label | a | b | -------------------------+---+---+ equal non-empty strings | x | x | -------------------------+---+---+ 1 row in result (first row: 4 msec; total: 5 msec) troels@microsoft:windows> SELECT * FROM testtab WHERE a<>b; -----------------------------+---+---+ label | a | b | -----------------------------+---+---+ b empty string | a | | non-equal non-empty strings | x | y | -----------------------------+---+---+ 2 rows in result (first row: 14 msec; total: 16 msec) troels@microsoft:windows> SELECT * FROM testtab WHERE b IS NULL; -----------+--------+--------+ label | a | b | -----------+--------+--------+ both null | [NULL] | [NULL] | -----------+--------+--------+ 1 row in result (first row: 3 msec; total: 4 msec) troels@microsoft:windows> SELECT * FROM testtab WHERE b IS NOT NULL; -----------------------------+--------+------------+ label | a | b | -----------------------------+--------+------------+ a null | [NULL] | b not null | a null, b empty string | [NULL] | | b empty string | a | | equal non-empty strings | x | x | non-equal non-empty strings | x | y | -----------------------------+--------+------------+ 5 rows in result (first row: 3 msec; total: 6 msec)