首页 > 数据库技术 > 详细

mysql 常用技巧

时间:2014-06-07 05:38:50      阅读:399      评论:0      收藏:0      [点我收藏+]

1.正则使用 比 LIKE 会牺牲很多的系统资源 尽量不要用

  正则的语法和JS PHP 差不多

  select * from t1 where email REGEXP "@163[,.]com$";

  select * from t1 where email like "%@163.com" or email like "%@163,com"

2.REPLACE 函数的使用

  UPDATE `v9_zhushou` SET `thumb` = REPLACE(`thumb`, ‘http://localhost/ciwei/‘, ‘http://www.qciwei.com/ciwei/‘) WHERE `id` > 0

  UPDATE `v9_zhushou_data` SET `iphone` = REPLACE(`iphone`, ‘http://localhost/ciwei/‘, ‘http://www.qciwei.com/ciwei/‘) WHERE `id` = 300

  

  

mysql 常用技巧,布布扣,bubuko.com

mysql 常用技巧

原文:http://www.cnblogs.com/mr-amazing/p/3755730.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!