插入数据

来源:互联网 发布:网络使人更亲近的例子 编辑:程序博客网 时间:2024/05/24 07:40

导数据命令:

exp 用户名/密码@网络连接名 file='备份文件存储路径' grants=y owner=需备份的用户名

imp 用户名/密码@网络连接名 file='备份文件存放的路径' grants=y ignore=y fromuser=源数据用户名 touser=目标用户名



多表插入

insert all
into a(lastname) values(last_name)
into b(sex) values(sex)
select last_name,sex from employees;



通过select 子查询数据插入表薪水乘以10%

insert into scott.bonus(ename,job,sal)

select ename,jop,sal*.10


条件插入多张表 

根据汇总金额大小分别插入不同的表
insert all
when sum_orders <1000 then 
into small_customers
when sum_orders >=10000 and sum_orders<100000 then
into medium_customers
else 
into large_customers
select customer_id,sum(order_total) sum_orders
from oe.orders
group by customer_id 

原创粉丝点击