Oracle 多表选择性插入

insert all|first                 ----  ALL 符合条件的都插入, FIRST 只插入第一个符合条件的
when sum_orders < 10000 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;

 

posted @ 2013-12-14 21:08  聆听自由  阅读(273)  评论(0编辑  收藏  举报