I need to update a table with past missing information using past versions of the same table. The update is needed as some earlier information are not available anymore in the most recent table. Let tableA be the table at time0 and tableB the table at time1 and so on. What i'm really interested in is the last updated table.
So far i have tried this method;
create view _tableB
select *
from tableA
union
select *
from tableB a
where a.id not in (select id from tableA);
then I proceeded with:
create view _tableC
select *
from _tableB
union
select *
from tableC a
where a.id not in (select id from _tableB);
and so on till i reach my final table where i create a table.
create table _tableT
select *
from _tableS
union
select *
from tableT a
where a.id not in (select id from _tableS);
Do you see something better up here?
P.S: I have to mention that for each observations i can have many languages. The information was in this way
id|lguage1|lguage2|lguage3|
and i put it wide2long using a view and this method.
id1|lguage1
id1|lguage2
id1|lguage3
id2|lguage1
The informations are not sorted by id and language.
Thanks.