The source aliased to h, So u need to use alias name every where. Assume orderId is always string.
MERGE INTO order as o USING history AS h ON KEY 'order::' || h.orderId
WHEN MATCHED THEN UPDATE SET o.paidDate = h.dateThe source aliased to h, So u need to use alias name every where. Assume orderId is always string.
MERGE INTO order as o USING history AS h ON KEY 'order::' || h.orderId
WHEN MATCHED THEN UPDATE SET o.paidDate = h.date