mysql 常用sql查询语句


UPDATE `mac_vod` SET `vod_name` = regexp_replace(vod_name,'日语版$','日语') where `vod_name` REGEXP '日语版$';
#播放器标题添加泰语
UPDATE `mac_vod` SET `vod_play_url` = replace(vod_play_url,'$','蒙古语版$') where `vod_name` REGEXP '蒙古语版$';

#去掉名称中最后的泰语
UPDATE `mac_vod` SET `vod_name` = regexp_replace(vod_name,'蒙古语版$','') where `vod_name` REGEXP '蒙古语版$';

#替换年份
UPDATE `mac_vod` SET `vod_name` = regexp_replace(vod_name,'19[0-9]{2}$','') where `vod_name` REGEXP '19[0-9]{2}$';
#查询行尾是语的
SELECT * FROM `mac_vod` WHERE `vod_name` REGEXP '语版$';

UPDATE mac_vod  set vod_name1=trim(vod_name1);
#删除前后空格