tektipuser2008
Programmer
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 :
Col1 Col2
D1 K1
D3 K2
Explanation : Since K1 is associated with D1, all other associations of K1 should be dropped, similarly since D3 is associated with K2 all other associations of D3 should be dropped.
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 :
Col1 Col2
D1 K1
D3 K2
Explanation : Since K1 is associated with D1, all other associations of K1 should be dropped, similarly since D3 is associated with K2 all other associations of D3 should be dropped.