Ok.
So your transformation is searching for addresses with same address code. Correct?
In that case, its easier to concatenate b,c,d,e and f corresponding to the address code in a.
Like this
b||'-'||c||'-'||d||'-'||e||'-'||f||'-'||
To get the first occurance use word_ext function
word_ext(concatenatedcolname,1,'-')
This should solve the issue.
Arun