I am having a problem write a query that fill in the blank value. I know it sounds confusing so let me demonstrate and explain.
Says, I have a query "Select Name, Serial, TrackNum From Table1" and the result is below:
Table1
Name Serial TrackNum
AAA
AAA 222 T1
BBB 333 T1
BBB 444 T2
BBB 555
BBB 666
CCC 777 T3
CCC 888
CCC 999
DDD 998
EEE 997 T4
EEE 996
FFF T5
I am having problem to form a query to produce this result below. You see that Serial# 555 and 666 were inherited "T2" from the row above, and same thing for Serial# 888 and 999. However, part# DDD has serial but not track#. And FFF has not serial but track#.
Name Serial TrackNum
AAA
AAA 222 T1
BBB 333 T1
BBB 444 T2
BBB 555 T2
BBB 666 T2
CCC 777 T3
CCC 888 T3
CCC 999 T3
DDD 998
EEE 997 T4
EEE 996 T4
FFF T5
Please help and appreciate if you provide sample code.