备份
create table bilhdr_20100614 as
select * from bilhdr where biltyp='SX' and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')>='2010-06-14 18:23'
and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')<='2010-06-14 18:25'
and bilid like 'JX%'
create table bilDTL_20100614 as
select * from bildtl where biltyp='SX' and (dat,bilid) in (
select dat,bilid from bilhdr where biltyp='SX' and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')>='2010-06-14 18:23'
and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')<='2010-06-14 18:25'
and bilid like 'JX%')
删除
delete from bilhdr where biltyp='SX' and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')>='2010-06-14 18:23'
and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')<='2010-06-14 18:25'
and bilid like 'JX%'
delete from bildtl where biltyp='SX' and (dat,bilid) in (
select dat,bilid from bilhdr where biltyp='SX' and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')>='2010-06-14 18:23'
and to_char(crtdat,'yyyy-mm-dd hh24:mi:ss')<='2010-06-14 18:25'
and bilid like 'JX%')
恢复回去
insert into bilhdr select * from bilhdr_20100614