[thelist] mysql error using select to update

Paul Bennett Paul.Bennett at wcc.govt.nz
Tue Jan 13 19:24:25 CST 2009

Apologies, my memory != correct.

This is the correct syntax for setting a var in mysql:

mysql> select @myvar := name from accounts where id = "1";

And to use the var:

mysql> update accounts set name = @myvar where id = "4";

If I answered a question correctly that Rudy didn't, I'm pretty sure either
A) the world is about to end
B) or this is all a dream and I'm about to wake up


More information about the thelist mailing list