- Java code
A表pscode effectdate terminationdate 1 2 3 B表pscode effectdate terminationdate 1 2011-01-01 2012-01-122 2009-10-22 2012-06-103 2007-02-02 2011-11-054 2010-02-03 2010-10-115 2009-09-09 2012-01-05请问我怎么把B表里的effectdate字段和terminationdate字段插入到A表中,不等于A表中pscode的不插入进来
------解决方案--------------------
- SQL code
update A set effectdate=B.effectdate ,terminationdate=B.terminationdate from B where A.pscode=B.pscode
------解决方案--------------------
- SQL code
update a set a.effectdate=b.effectdate,a.terminationdate=b.terminationdatefrom bwhere a.pscode=b.pscode