What I Hate About Your Programming Language
Subject:   Re: What I Hate About SQL
Date:   2005-12-29 09:53:44
From:   ababiec
Response to: Re: What I Hate About SQL

Don't forget you can also use a subquery instead of a values list, so I'm not sure how your example address that scenario...

INSERT INTO <table> (<columns>) SELECT <columns> FROM <tables> WHERE <conditionals>

And INSERTs don't require a columns list if the values match the column order of the table.

Never mind examples such as...

WHEN order_total < 1000000 THEN
INTO small_orders
WHEN order_total > 1000000 AND order_total < 2000000 THEN
INTO medium_orders
WHEN order_total > 2000000 THEN
INTO large_orders
SELECT order_id, order_total, sales_rep_id, customer_id
FROM orders;