It is appropriate to use this statement when you frequently encounter the insertion of data into several different tables during Oracle operations. All represents a non-short-circuit operation, that is, if the first condition is met, and a check is performed to see if the other conditions are met, and a short operation finds the appropriate condition and does not go down. INSERT All
When prod_category= ' B ' THEN
Into Book_sales (prod_id,cust_id,qty_sold,amt_sold)
VALUES (Product_id,customer_id,sale_qty,sale_price)
When prod_category= ' V ' THEN
Into Video_sales (prod_id,cust_id,qty_sold,amt_sold)
VALUES (Product_id,customer_id,sale_qty,sale_price)
When prod_category= ' A ' THEN
Into Audio_sales (prod_id,cust_id,qty_sold,amt_sold)
VALUES (Product_id,customer_id,sale_qty,sale_price)
SELECT prod_category, product_id, customer_id, Sale_qty
, Sale_price
From Sales_detail; Merging Rows into a Table
MERGE into Oe.product_information Pi
USING (SELECT product_id, List_price, Min_price
From New_prices) NP
On (pi.product_id = np.product_id)
When matched THEN UPDATE SET pi.list_price =np.list_price
, Pi.min_price = Np.min_price
When not matched THEN INSERT (pi.product_id,pi.category_id
, Pi.list_price,pi.min_price)
VALUES (np.product_id, 33,np.list_price, Np.min_price);