I have a query which returns the following sample data :-
SELECT * FROM VW_STATUSNEW
ID STATUS_1 STATUS_2
1 FAIL 1
2 FAIL NULL
3 1 NULL
4 NULL 2
5 2 2
6 2 FAIL
7 NULL NULL
Is it possible in Oracle to return all rows where STATUS_1 and STATUS_2 do not match. So, using the data above, the required results are :-
ID STATUS_1 STATUS_2
1 FAIL 1
2 FAIL NULL
3 1 NULL
4 NULL 2
6 2 FAIL
The issue seems to be with comparing the word FAIL with a number, and catering for NULLs.