单表分解

 
INSERT {all | first}
                               [when then]
                                     into [(col1,col2, ··· )]
                                     [values(val1,val2, ··· )]
                               [when then]
                                     into [(col1,col2, ···)]
                                     [values(val1,val2, ···)]
                               ···
                               ···
                               [when then]
                                     into [(col1,col2, ···)]
                                     [values(val1,val2, ···)]
                               [else
                                     into [(col1,col2, ···)]
                                     [values (val1,val2, ···)]
                               ]
               Subquery-definition;
 
 
SQL> Create table small_orders(order_id   number(12)   not null,
                                                              customer_id number(6) not null,
                                                              order_total   number(8,2),
                                                              sales_rep_id number(6)
                                                              );
SQL> Creat table medium_orders as select *  from small_orders;
SQL> Creat table large_orders as select *  from small_orders;
SQL>Create table  special_orders(order id number(12) not null,
                                                                 customer_id number(6),
                                                                 order_total number(8,2),
                                                                 sales_rep_id number(6),
                                                                 credit_limit number(9,2),
                                                                 cust_email   varchar2(30)
                                                                 );
 
Insert all
     when ottl < 10000 then
          into small_orders
     when ottl > 10000 and ottl < 20000 then
          into medium_orders
     when ottl> 20000 then
          into large_orders
     when ottl>29000 then
          into special_orders
      select o.order_id oid, o.customer_id cid, o.order_total ottl,
                   o.sales_rep_id sid, c.credit_limit cl, c.cust_email cem
      from orders o, customers
      where o.customer_id = c.customer_id;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7356664/viewspace-509514/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 多表合并
下一篇: 触发器
user_pic_default.png
请登录后发表评论 登录
全部评论
<%=items[i].createtime%>

<%=items[i].content%>

<%if(items[i].items.items.length) { %>
<%for(var j=0;j
<%=items[i].items.items[j].createtime%> 回复

<%=items[i].items.items[j].username%>   回复   <%=items[i].items.items[j].tousername%><%=items[i].items.items[j].content%>

<%}%> <%if(items[i].items.total > 5) { %>
还有<%=items[i].items.total-5%>条评论) data-count=1 data-flag=true>点击查看
<%}%>
<%}%> <%}%>

转载于:http://blog.itpub.net/7356664/viewspace-509514/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值