1.动态更新某个字段
update ot_dstrregtaxpayerbasic
set taxofficialcode = (select taxofficialcode from tb_basic_enterprisebasicinfo where tb_basic_enterprisebasicinfo.taxregcode = ot_dstrregtaxpayerbasic.taxregcode)
2.按日期排序,读取前N条记录
select * from (select * from ot_overdueregtaxpayer where trunc(regdate,'dd') = to_date('2011-03-29','yyyy-mm-dd') order by REGDATE desc) where rownum <=1;
update ot_dstrregtaxpayerbasic
set taxofficialcode = (select taxofficialcode from tb_basic_enterprisebasicinfo where tb_basic_enterprisebasicinfo.taxregcode = ot_dstrregtaxpayerbasic.taxregcode)
2.按日期排序,读取前N条记录
select * from (select * from ot_overdueregtaxpayer where trunc(regdate,'dd') = to_date('2011-03-29','yyyy-mm-dd') order by REGDATE desc) where rownum <=1;