Say I have a select
SELECT DISTINCT id, customer_id, domain FROM config WHERE type = \'foo\';
which returns some records.
How can I do
INSERT INTO Config (id, customer_id, domain) SELECT DISTINCT id, customer_id, 'www.example.com' FROM config
The MySQL documentation for this syntax is here:
http://dev.mysql.com/doc/refman/5.1/en/insert-select.html