Hi, I have a doubt about merge statement, I need update the record when EXISTS and its status is NOT resolved and LastUpdate < newRecord.lastUpdate , and INSERT when NOT EXISTS.
the query is like this:
merge into mybucket
using (select id from mybucket where lastUpdate < newRecord.lastUpdate and status != “RESOLVED”)
when matched then UPDATE SET…
I think that to INSERT it should comply whitn the ONLY condition IS NOT EXIST.
I appreciate your help.