conditional insert with values; insert into .. values(...) where not exist (....);
Date: Tue, 29 Apr 2008 08:08:52 -0700 (PDT)
This is what I wish I could to do.
insert into table_x (a, b, c)
values(1, 2, 3)
where not exist (select * from table_x where a = 2);
I've seen conditional inserts without values(....), as in
INSERT INTO clients
(client_id, client_name, client_type)
SELECT supplier_id, supplier_name, 'advertising'
WHERE NOT EXISTS (SELECT *
FROM clients WHERE clients.client_id =suppliers.supplier_id); Received on Tue Apr 29 2008 - 10:08:52 CDT