日期:2014-05-17 浏览次数:20652 次
-- 查询语句
select Coalesce(dept.deptname, a.deptname ) as '改变列',* from dept
left join dept a on a.id = dept.id-1
---修改语句
update dept set
dept.deptname =( case when dept.deptname is not null then dept.deptname else
a.deptname end ) from dept
left join dept a on a.id = dept.id-1