This has an example of using a SELECT statement inside of an INSERT statement. It confused me at first. I thought one was inserting and then selecting back the record inserted while changing its shape. Not so! One is selecting things to insert with the SELECT statement.
INSERT INTO suppliers
(supplier_id, supplier_name)
SELECT account_no, name
FROM customers
WHERE city = 'Newark';
No comments:
Post a Comment