Sorry that I'm having trouble explaining this but you almost have it stated right... It must have been my error
If the rows look like this.
AA1,AB1,null,null
AA2,AB2,null,AA3
AA3,AB3,AA2,null
The result has to look like this.
AB XY XZ
== == ==
AB1 ' ' ' '
AB2 AB3...