Sample Header Ad - 728x90

case when IsNull Alternatives?

0 votes
1 answer
1992 views
Is there a way, to optimize this query, where several IsNull in relation with dates are used? Unfortunately the query is a way slow and actually I have no glue, how to make it way faster. case when IsNull(A.TD, '1900-01-01') > IsNull(B.TD, '1900-01-01') then IsNull(A.TD, '1900-01-01') when IsNull(A.TD, '1900-01-01') < IsNull(B.TD, '1900-01-01') then IsNull(B.TD, '1900-01-01') when IsNull(A.TD, '1900-01-01') = IsNull(B.TD, '1900-01-01') then S.TE end as DZ Thank you.
Asked by Tobias A. (3 rep)
Jan 5, 2018, 09:04 PM
Last activity: Jan 6, 2018, 12:33 AM