2007-05-25

oralce常用SQL语句

关键字: 数据库

1.复制表 从B表复制到A表,会丢失主键和索引

create table A as select * from B

 2.删除某张表排序后的前三十万笔数据,注意排序的列要见索引

delete from fm_temp t where t.dctime in

select dctime from (select dctime from fm_temp f  order by  f.dctime) where ROWNUM < 300000

 )

fm_temp是表名,dctime是排序的列

 

评论
发表评论

您还没有登录,请登录后发表评论

fantasy
搜索本博客
最近加入圈子
存档
最新评论