![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
non-perl SQL questionby Anonymous Monk |
on Dec 31, 2003 at 04:40 UTC ( #317829=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Can you swap two values in SQL in one statement?
For instance, if I have records with an "order" value, and want to swap six and five around so that six becomes five and five becomes six, can I do it in one statement? I'm not in a position to test this at the moment. I was thinking you'd have to temporarily set the "order" value five to null, or a million or something, then make six into five and the temporarily-changed record into six. Because if you do it like this:
then you're just going to end up with two sixes, aren't you? And if you do "limit =1" then you don't know which one you're going to get.
Back to
Seekers of Perl Wisdom
|
|