I would like to insert into the table OUTPUT the data from the table INPUT. Both, INPUT and OUTPUT have these columns: name, 1H,2H,3H,4H,5H,6H. The data in INPUT have a hierarchy structure. Into the OUTPUT goes from INPUT the last name in hierarchy.
The column in INPUT labeled "goes to OUTPUT?" is not a part of my table .... I added this column only for better understanding, which row goes to OUTPUT
Can you advise the correct SQL command? I am working in excel - vba and LAG, LEAD seems not to be working in EXCEL- vba. I tried UNION (ALL) but it did not work