Reputation: 12040
Im trying to filter the category 'Student'. But NULL category also filtering out. Could you please let me know how to filter only Student not NULL value.
Query:
select * from customer where category != 'Student'
Upvotes: 0
Views: 57
Reputation: 191275
Null isn't comporable with anything, even itself. To include it you need to have a separate condition for it:
select * from customer where category is null or category != 'Student'
You could also nvl
or coalesce
the column to a magic value, but explicitly looking for null is cleaner, I find.
Upvotes: 1