mysql技巧:按条件筛选,然后替换
程序员文章站
2022-06-26 20:30:12
1、按条件筛选,然后替换 select * from phome_ecms_tv where playurl like '%关键词%';update phome_ecms_tv set myorder=REPLACE(myorder,'99','444') 2、删除含某关键词的内容 delete f ......
1、按条件筛选,然后替换
select * from phome_ecms_tv where playurl like '%关键词%';
update phome_ecms_tv set myorder=REPLACE(myorder,'99','444')
2、删除含某关键词的内容
delete from phome_ecms_tv where playurl like '%关键词%'
(delete+like执行命令,当'%%'中的关键词为空时,会清空整个数据库)