SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


swap value in one column


swap value in one column

Author
Message
gsansofteng
gsansofteng
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 16
Is there a quick way to swap a set of values in one column?
I have labels that need to be swapped:

OLD NEW
Axis Index Label Axis Index Label
X 0 A X 0 1
X 1 B X 1 2
X 2 C X 2 3
Y 0 1 X 3 4
Y 1 2 Y 0 A
Y 2 3 Y 1 B
Y 3 4 Y 2 C

I can't switch the axis because ther are other columns that need to remain with the axis.
Do I have to create a temporary table to store one set of data, then update the other set and then replace the first set with the temporary data or is there an easier way to do this?

Thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search