The below query is part of a select query which I have got in my application
where
case when o.tracking_id <> '0' then a.account_id is null
and
o.status = 'N'
else
(
o.tracking_id = '0'
and
o.status = 'N'
)
END
I am having hardtime to understand the below line
Can you please tell me what does this exactly mean ?
case when o.tracking_id <> '0' then a.account_id is null
2
Answers
I wouldn’t use a
CASE
expression here but instead would use the following logic:The condition is written somewhat clumsily. It is equivalent to this more readable expression: