mysql 常用技巧
            时间:2014-06-07 06:05:12  
            收藏:0  
            阅读:280
        
        
        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
            评论(0)
        
        
        