ITPub博客

首页 > Linux操作系统 > Linux操作系统 > multitable INSERT(insert 新语句用法 )

multitable INSERT(insert 新语句用法 )

原创 Linux操作系统 作者:handsomeSJG 时间:2009-05-11 01:41:31 0 删除 编辑

INSERT FIRST
WHEN policy_type = 'P' THEN
      INTO property_premium_fact(policy_id,policy_nbr ,premium_amt)
      VALUES (property_premium_seq.nextval,policy_number ,gross_premium)
WHEN p.policy_type = 'C' THEN
     INTO property_premium_fact(policy_id,policy_nbr ,premium_amt)
     VALUES (property_premium_seq.nextval,policy_number ,gross_premium)
SELECT policy_nbr ,gross_premium ,policy_type
FROM policies
WHERE policy_date >=
TRUNC(SYSDATE,'MM') - TO_YMINTERVAL('00-01');


--By using this multitable INSERT statement instead of two separate statements, the code makes
--a single pass through the policy table instead of two and thus loads the data more efficiently

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

请登录后发表评论 登录
全部评论

注册时间:2008-11-19

  • 博文量
    23
  • 访问量
    46637