At 06:35 PM 8/1/2006, Martin Jespersen wrote:
I just ran the following sql (on mysql 4.1.20):

  update tbl set col1=col2, col2=col1

To my surprise, mysql updates col1 via col1=col2 before reading it for use in col2=col1, so I end up with the same value in both columns, which, of course, was not my intention. Thinking about it, this behavior in mysql makes perfect sense, so thats not the issue.

If this is a one-time operation, it would seem easier to rename the columns. In some cases, even if it's a little more frequent than that.


Barry



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to