I have the following data
| Id | Indicator_1 | Indicator_2 | Order_Number |
|---|---|---|---|
| 1 | X | L | 123 |
| 2 | X | null | 123 |
| 3 | X | null | null |
| 4 | null | null | null |
| 5 | null | null | 456 |
The logic should be hide if:
- IF indicator_1 = X AND indicator_2 = L, then hide the record
- if indicator_1= X and Order_Number is null, then hide the record
I want to exclude rows 1 and 3 from the table
I tried the following query but this doesn't seems to be working
SELECT a.id,
a.Indicator_1,
a.Indicator_2,
a.Order_Number,
a.*
FROM dummy a
WHERE ( ( a.indicator_1 <> 'X'AND a.indicator_2 <> 'L' )
OR
( a.indicator_1 <> 'X'AND a.Order_Number IS NOT NULL )
)