松鼠短视频系统为用户加入随机头像代码-快速为用户加上随机头衔

update tp_user
set head_img='图片1'
where id IN(
select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='图片2'
where id IN(
select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='图片3'
where id IN(
select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);

以上代码执行即可,此前写了蜻蜓q系统如何随机加入头像,由于松鼠短视频字段不同因此也列一个方便大家使用。

自己使用记录:

update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270837516589514941.png'
where id IN(
select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270835149436524711.png'
where id IN(
    select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270834429074265079.png'
where id IN(
    select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270836314036839413.png'
where id IN(
select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270836157965414975.png'
where id IN(
    select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);
update tp_user
set head_img='http://qingtingcun.youyacao.com/qiniu_202110270835431933928235.png'
where id IN(
    select A.* from(select id from tp_user where head_img='' order by rand() limit 10) AS A
);

此前相关文章

数据库进阶·如何针对所有用户数据中没有的数据去加入随机的数据-蜻蜓Q系统用户没有头像如何加入头像数据-优雅草科技kir_~央千澈~的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/dujiangdu123/article/details/126099174