MySQL 当记录不存在时insert,当记录存在时update

2018-10-10
INSERT INTO clients
(client_id, client_name, client_type)
SELECT 10345, 'IBM', 'advertising'
FROM dual
WHERE not exists (select * from clients
where clients.client_id = 10345);


相关文章: