Hi All,
Have a question regarding a Where clause filter on a string(varchar)
column. My table is as follows,
CREATE TABLE IF NOT EXISTS TEST1 (
"id" UNSIGNED_LONG NOT NULL,
"status" VARCHAR, CONSTRAINT "pk_1" PRIMARY KEY ("id")) VERSIONS = 2;
The table is populated to look like,
0: jdbc:phoenix:localhost> select * from TEST1;
+-----+----------+
| id | status |
+-----+----------+
| 1 | live |
| 2 | deleted |
| 3 | | <-- row has status == NULL
+-----+----------+
Now if I want all the rows that do not have status as deleted, I use the
query, *select * from TEST1 where "status" != 'deleted';*
But this returns me only 1 row,
0: jdbc:phoenix:localhost> select * from TEST1 where "status" != 'deleted';
+-----+---------+
| id | status |
+-----+---------+
| 1 | live |
+-----+---------+
Why is the row with a NULL status being filtered out?
Help appreciated.
Cheers,
Anirudha