我有一个表wp_blogs,如下所示
CREATE TABLE IF NOT EXISTS `wp_blogs` (
`blog_id` bigint(20) NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) NOT NULL DEFAULT '0',
`domain` varchar(200) NOT NULL DEFAULT '',
`path` varchar(100) NOT NULL DEFAULT '',
`registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`public` tinyint(2) NOT NULL DEFAULT '1',
`archived` tinyint(2) NOT NULL DEFAULT '0',
`mature` tinyint(2) NOT NULL DEFAULT '0',
`spam` tinyint(2) NOT NULL DEFAULT '0',
`deleted` tinyint(2) NOT NULL DEFAULT '0',
`lang_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`blog_id`),
KEY `domain` (`domain`(50),`path`(5)),
KEY `lang_id` (`lang_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
INSERT INTO `wp_blogs` (`blog_id`, `site_id`, `domain`, `path`, `registered`, `last_updated`, `public`, `archived`, `mature`, `spam`, `deleted`, `lang_id`) VALUES
(1, 1, 'wordpress1001.com', '/rooturl/', '2015-02-18 02:45:37', '0000-00-00 00:00:00', 1, 0, 0, 0, 0, 0),
(2, 1, 'wordpress1001.com', '/rooturl/site1/', '2015-02-18 02:49:08', '2015-02-18 02:49:27', 1, 0, 0, 0, 0, 0),
(3, 1, 'wordpress1001.com', '/rooturl/site2/', '2015-02-18 02:50:09', '2015-02-18 02:50:38', 1, 0, 0, 0, 0, 0),
(4, 1, 'wordpress1001.com', '/rooturl/site3/', '2015-02-18 02:50:59', '2015-02-18 02:51:35', 1, 0, 0, 0, 0, 0);
我想将字段路径更新为其他名称。 例如: -
(1, 1, 'wordpress1001.com', '/testurl/', '2015-02-18 02:45:37', '0000-00-00 00:00:00', 1, 0, 0, 0, 0, 0),
(2, 1, 'wordpress1001.com', '/testurl/site1/', '2015-02-18 02:49:08', '2015-02-18 02:49:27', 1, 0, 0, 0, 0, 0),
(3, 1, 'wordpress1001.com', '/testurl/site2/', '2015-02-18 02:50:09', '2015-02-18 02:50:38', 1, 0, 0, 0, 0, 0),
(4, 1, 'wordpress1001.com', '/testurl/site3/', '2015-02-18 02:50:59', '2015-02-18 02:51:35', 1, 0, 0, 0, 0, 0);
rooturl或testurl将是动态值。我会改变依赖于客户。但是site1,site2和site3是不变的。 任何人都可以帮我写一个SQL查询来更新表吗?
由于