Hello:
To simplify my question, suppose I have one table with one field named
Score. Scores can be 1, 2, 3, 4, or 5. Here's how the table appears
originally:
Score
1
2
3
4
5
4
3
2
1
Suppose I wanted these values to be reversed, meaning I want all 1s to
be 5s, 2s to be 4s, 4s to be 2s, and 5s to be 1s. I'm looking for a
creative way of doing this using a stored procedure. I want make sure
that this procedure doesn't go through the entire table changing 1s to
5s first, then goes through the entire table again changing 2s to 4s,
followed by 4s to 2s, and finally 5s to 1s, as it would result in the
following:
Score
1
2
3
2
1
2
3
2
1
The desired result would be:
Score
5
4
3
2
1
2
3
4
5
Thanks,
DaveTry:
Update Table
set value = 6 - value
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment