Hi Danili_fme, thanks for your time and resolution.
I will narrate my requirement in detail as below.
In ID1 "111111" are having 4 duplicate values whereas the ID2 values are different for that group, I need to get the 1st record as a result, after this the ID2 "222222" need the 2nd value from ID2, and so on. Here I don't want to match the first character in ID1 and ID2.