I have a table in sql server 2000. it looks like this:
id username value week
1 john 0 1
2 john 1 1
3 john 0 1
4 john 1 1
5 john 1 1
6 john 0 1
7 john 1 1
8 john 1 1
9 john 0 1
1 craig 1 1
2 craig 0 1
3 craig 1 1
4 craig 0 1
5 craig 1 1
6 craig 1 1
7 craig 0 1
8 craig 1 1
9 craig 0 1
I need to replace the inverse of TOP 5, in this case it would be four. I need to replace those 4 with a value of 4 instead of 1. The problem is I need to replace the 4's randomly for each username.........
i give up i tried so many 5 step processes.....
i am not sure it is possible.......
i would expect the results to look like this....
id username value week
1 john 0 1
2 john 1 1
3 john 4 1
4 john 1 1
5 john 4 1
6 john 0 1
7 john 1 1
8 john 4 1
9 john 4 1
1 craig 1 1
2 craig 4 1
3 craig 4 1
4 craig 0 1
5 craig 1 1
6 craig 1 1
7 craig 4 1
8 craig 1 1
9 craig 4 1
id username value week
1 john 0 1
2 john 1 1
3 john 0 1
4 john 1 1
5 john 1 1
6 john 0 1
7 john 1 1
8 john 1 1
9 john 0 1
1 craig 1 1
2 craig 0 1
3 craig 1 1
4 craig 0 1
5 craig 1 1
6 craig 1 1
7 craig 0 1
8 craig 1 1
9 craig 0 1
I need to replace the inverse of TOP 5, in this case it would be four. I need to replace those 4 with a value of 4 instead of 1. The problem is I need to replace the 4's randomly for each username.........
i give up i tried so many 5 step processes.....
i am not sure it is possible.......
i would expect the results to look like this....
id username value week
1 john 0 1
2 john 1 1
3 john 4 1
4 john 1 1
5 john 4 1
6 john 0 1
7 john 1 1
8 john 4 1
9 john 4 1
1 craig 1 1
2 craig 4 1
3 craig 4 1
4 craig 0 1
5 craig 1 1
6 craig 1 1
7 craig 4 1
8 craig 1 1
9 craig 4 1