Using Teradata ordered analytical functions , is it possible to get the result set below. If yes, can someone please provide me with some hints or the SQL itself.
Any help with this is much appreciated.
Sample Data :
Col1 Col2
D1 K1
D2 K1
D3 K2
D3 K4
D4 K1
D5 K2
Result set ...