我有一个名为 users 的数据库表(25k 记录)
在里面我有一个名为“头像”的字段
我需要更新此字段,从列表中分配一个随机 url
列表网址:
http://myserver.com/img/1.png http://myserver.com/img/2.png http://myserver.com/img/3.png http://myserver.com/img/4.png http://myserver.com/img/5.png http://myserver.com/img/6.png http://myserver.com/img/7.png http://myserver.com/img/8.png http://myserver.com/img/9.png http://myserver.com/img/10.png http://myserver.com/img/11.png http://myserver.com/img/12.png http://myserver.com/img/13.png http://myserver.com/img/14.png http://myserver.com/img/15.png
我有这个代码:
UPDATE TABLE SET VALUE=VALUE+ROUND(1+RAND()*4);
我该如何调整这个查询?