I have historical data stored in a historical table, and current table in different tables. When I get similar data from each table, how do I join the data, but remove items from the historical data, if we have more recent, current data, when I join the data?
example:
Historical found:
ID LastReboot1 LastReboot2
4622 11-09-2022 11-09-2022
0462 21-09-2021 21-09-2021
0099 19-10-2021 19-10-2021
Current found:
4622 18-09-2022 18-09-2022
0462 20-09-2022 20-09-2022
I figure I can do a join between the 2 queries, but wouldn't that keep the duplicated data? So I'd wind up with this:
ID LastReboot1 LastReboot2
4622 11-09-2022 11-09-2022
4622 18-09-2022 18-09-2022
0462 20-09-2022 20-09-2022
0462 21-09-2021 21-09-2021
0099 19-10-2021 19-10-2021
I want it to wind up with this (keeping current id's with newer data, but bringing historical data where there isn't current data):
ID LastReboot1 LastReboot2
4622 18-09-2022 18-09-2022
0462 20-09-2022 20-09-2022
0099 19-10-2021 19-10-2021
I don't think that would be a join. I appreciate help on this. I know it's probably basic knowledge for some of you experts out there. I tried googling it, but I'm not finding the anser to what I need.