【发布时间】:2009-01-21 08:21:29
【问题描述】:
我继承了 MYSQL 数据库,该数据库有很多表,其中包含类似
的数据CREATE TABLE IF NOT EXISTS `ejl_registration` (
`id` int(11) NOT NULL auto_increment,
`team_id` int(11) default NULL,
`start_date` date default NULL,
`end_date` date default NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=88668 ;
start_date 和 end_date 应该具有如下值:
- 2007-1-5, 2007-12-31
- 2008-1-1, 2008-12-31
- 2009-1-15,2009-12-31
但其中一些 en_date 字段为 NULL 或 0000-00-00。 有没有办法让单个查询更新所有那些无效的 en_date 字段并将它们的值设置为年末等于 start_date 的年份
【问题讨论】:
标签: sql