Finally, the next example uses the FIRST clause to put orders greater than 2,900,000 into the special_orders table and exclude those orders from the large_orders table:
INSERT FIRST WHEN ottl 100000 and ottl 200000 THEN INTO large_orders VALUES(oid, ottl, sid, cid) 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 c WHERE o.customer_id = c.customer_id;上面的是两个表中都插入了数据,
下面的是first插 special_orders,large_orders不再插入重复数据:p
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-263478/ ,如需转载,请注明出处,否则将追究法律责任。