请教各位:
        我的表中的其中一个字段是存放的是文章的内容,内容有文字也有http://这样的连接,但是没有什么规律,我用like查询了一下,有一万多条,如果一条一条删除,我还不风了,有没有什么方法 批量删除这个字段中的连接的(http//这样的连接).     或者有别的办法也可以 谢谢了.

解决方案 »

  1.   


    mysql> create table c_t ( f1 varchar(255) not null, f2 varchar(255) not null) engine myisam;
    Query OK, 0 rows affected (0.01 sec)mysql> insert into c_t values('ss','http:\/\/www.sina.com\/'),('cc','http:\/\/www.163.com\/index.html');
    Query OK, 2 rows affected (0.01 sec)
    Records: 2  Duplicates: 0  Warnings: 0mysql> select * from c_t;
    +----+-------------------------------+
    | f1 | f2                            |
    +----+-------------------------------+
    | ss | http://www.sina.com/          | 
    | cc | http://www.163.com/index.html | 
    +----+-------------------------------+
    2 rows in set (0.00 sec)mysql> delete from c_t where f2 regexp '^http:\/\/.*';
    Query OK, 2 rows affected (0.01 sec)mysql> select * from c_t;
    Empty set (0.00 sec)mysql>