0

I have result set as follows

reg_no    name    grade
--------- ------- ------
1112      Muthu   A
1113      Vikki   B
1114      Murali  C
1115      Shankar null

I have checked the condition with not in

select * from grades where grade not in ('B','C')

But when executing query i have got only one record that have A grade. I didn't get the 4th row. Am stuck with this. How to check this.

2 Answers2

3

Only one proper way to check null existence is IS NULL and IS NOT NULL

select * from grades where grade not in ('B','C') or grade is null
0

Check like this

select * from grades where nvl(grade,'?') not in ('B','C');

But this appropriate cannot use index on grafes,if exists.

Dart XKey
  • 54
  • 3