Hi....
I have a table with two columns. Col1 contains ids and col2 contains brands for a particular id:
COL1 COL2
1 N
1 R
1 L
2 L
2 R
3 L
3 N
4 N
4 R
I want to update col2 such tht if an ID [col1] has brand [col2] N then all other brands for it should be update to N. N has the highest priority, then R and then L. That's if an ID [col1] has two brands R and L, then tht ID should be update to both brands as R. Similarly if an ID has all the three brands then all its brands should be updated to N
o/p shd be like this....
COL1 COL2
1 N
1 N
1 N
2 R
2 R
3 N
3 N
4 N
4 N
Plz help me....
sandeep.
I have a table with two columns. Col1 contains ids and col2 contains brands for a particular id:
COL1 COL2
1 N
1 R
1 L
2 L
2 R
3 L
3 N
4 N
4 R
I want to update col2 such tht if an ID [col1] has brand [col2] N then all other brands for it should be update to N. N has the highest priority, then R and then L. That's if an ID [col1] has two brands R and L, then tht ID should be update to both brands as R. Similarly if an ID has all the three brands then all its brands should be updated to N
o/p shd be like this....
COL1 COL2
1 N
1 N
1 N
2 R
2 R
3 N
3 N
4 N
4 N
Plz help me....
sandeep.
Comment