在A库中查,前提是你建了b的dblink select id from tablea not in (select id from tableb@b);
update tb set col_date=add_months(col_date,24) where to_char(col_date,'yyyy')='2003';
to: bzszp(SongZip) ( ) 数据并不是只有2003年的还有2002,2001的,我的意思是只要是小于2004的都改成2005年
update tb set col_date=to_date('2005'||to_char(col_date,'mmddhh24miss'),'yyyymmddhh24miss') where to_char(col_date,'yyyy')<'2004';
楼上的不好,这样会丢失毫秒等数据. 最好还是:update tb set col_date=add_months(col_date,24) where col_date>= to_date('2003','yyyy') and col_date<to_date('2004','yyyy') 使用to_char会破坏索引
select id from tablea not in (select id from tableb@b);
where to_char(col_date,'yyyy')='2003';
bzszp(SongZip) ( )
数据并不是只有2003年的还有2002,2001的,我的意思是只要是小于2004的都改成2005年
where to_char(col_date,'yyyy')<'2004';
最好还是:update tb set col_date=add_months(col_date,24)
where col_date>= to_date('2003','yyyy')
and col_date<to_date('2004','yyyy')
使用to_char会破坏索引