mysql - UPDATE ORDER BY RAND() LIMIT 100 -


i want set text different field trying kind of code

set  @rand = 100; update mytable set  name = 'a'  order rand() limit @rand; update mytable set  name = 'b'  order rand() limit @rand; update mytable set  name = 'c'  order rand() limit @rand; 

i getting error

1221 - incorrect usage of update , order by

thanks helping

why updating rand(). slow down update? order indexed column primary key. performance killer.

what's point of setting @rand = 100 when know how many records want update in 1 go?

i assuming have primary key called id

update mytable set  name = 'a'  order id desc limit 100; update mytable set  name = 'b'  order id desc limit 100; update mytable set  name = 'c'  order id desc limit 100; 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -