title: Oracle Multi-Table Insert Syntax?
body: <p>I'm taking my first look at Oracle's multi-table insert (I'm fairly new to SQL overall), and I'm not quite understanding the purpose/need for the <code>SELECT</code> at the end of the statement.</p>
  
  <p>With a single-table <code>INSERT</code>, it's my understanding that either the <code>VALUES</code> clause or a subquery are used, but not both. Can someone explain the significance of the <code>SELECT</code> clause at the end of this <code>INSERT</code> statement? I've looked online, but I haven't found a clear answer.</p>
  
  <pre><code>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;
  </code></pre>