I’ve got two tables:
events:
mac | na
----------
abc | (null)
abc | (null)
def | (null)
enrichments:
mac | na | timestamp
---------------------
abc | na1 | 1
abc | na2 | 2
abc | na3 | 3
def | na4 | 1
Now I want to update the events.na column with the values in enrichments.na, where mac matches, and timestamp is the maximum timestamp for that particular mac.
For this example, the result would be:
abc | na3
abc | na3
def | na4
What would be the most efficient way to do this?
Thanks!
1 Answer