1.使用 PL&SQL 导数据
在 tool 菜单中选择 "Export Data .." ,选择要导出的数据表,然后取消'删除表'选项,就可以导出数据表;
在 PL&SQL command 窗口中,使用 @'d:\user.sql'; 这样的方式就可以把 *.sql 中的数据导入。
2.新建一个表与原有表结构一样
create table b as select * from a where 1>2
要把原表中的数据全部导入就可以在 where 子句中设置条件为 2>1
3.使用日期分组查询
select count(1) from a_table where created between to_date('2007-12-01 0:0:0','yyyy-mm-dd HH24:mi:ss')
and to_date('2008-01-01 0:0:0','yyyy-mm-dd HH24:mi:ss')
select count(1) ,to_char(created,'yyyy-MM') from A_table group by to_char(created,'yyyy-MM')
阅读(740) | 评论(0) | 转发(0) |