mysql收集

1、字符串拼接、以什么开头、是否包含某个字符串

UPDATE `mc_application` a

SET a.copyright_registration = CONCAT(
'http://op-cp.oss-cn-hangzhou.aliyuncs.com/UPLOAD-PIC/',
a.copyright_registration
)
WHERE
left(a.copyright_registration,4) <> 'http' AND a.copyright_registration  <> ''
and a.copyright_registration is not NULL

and locate(',',a.copyright_registration) = 0; 


2、添加外键--外键表的字段必须保证主表里均有值

alter table pay_client_act add constraint fk_detail1_uid foreign key(uid) references ka_members_detail1(uid);

 ALTER TABLE pay_recharge_log DROP FOREIGN KEY fk_log_uid;

references:http://blog.csdn.net/alihoney/article/details/4800221

http://blog.csdn.net/zhangjq520/article/details/73289459

https://www.cnblogs.com/xiangxiaodong/archive/2013/05/05/3061049.html

发布了64 篇原创文章 · 获赞 9 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/eadela/article/details/78393500