During Oracle operations, data is often inserted into multiple different tables at the same time. This statement is very suitable. "All" indicates a non-short-circuit operation, that is, if the First condition is met, you must run the following command to check whether other conditions are met. However, if the First condition is found for the short-circuit operation, the operation will not proceed downward. 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 );