Case
when a.name and a.rownum=1 <> b.name and (b.namereason isnull or b.namereason in ('') and b.rownum=1 then a.name
when when a.name and a.rownum=1 <> b.name and (b.namereason isnotnull or b.namereason not in ('')) and b.rownum=1 then b.name
END as name
Note: I want to compare 2 tables.
A.RowNum = is take the max date
B.rownum = is take min date
I want compare the name if got update in B, then display B else display A.
I'm dealing with 10m+ records, cannot hardcode it. I need it to be working for generally.
i got error when doing something like this. error message is An expression of non-boolean type specified in a context where a condition is expected
any idea how to do something like?
a.name
and - you should write a condition for example whena.name = 'aaa'
and ' ...