Where clause: I should test column against value in Proc, but if at least one of them is null it should be TRUE as a result. Only when BOTH NOT NULL (it's Integer values for an ID column in a table) should the result of the compare be FALSE.
Now I have this: ...
and nvl(nvl(b.account_id, account_id_), 0) = nvl(nvl(account_id_, b.account_id), 0)
b.account__id
- is Column in table (Integer), account_id_
- Param in Proc of the same type.
It works, but IMHO it looks Strange to understand what is the purpose of the evaluation. So I tried to make it more READABLE, but without really good results.
I tried COALESCE - but it needs checking for null if both are nulls. LNNVL is a good one, but it gives FALSE if THEY BOTH Equal, but I need True for this case.
Any good Thoughts?