SQL Insert into table only if record doesn't exist [duplicate]
问题 This question already has answers here : Check if a row exists, otherwise insert (11 answers) MySQL Conditional Insert (12 answers) Closed 6 years ago . I want to run a set of queries to insert some data into an SQL table but only if the record satisfying certain criteria are met. The table has 4 fields: id (primary), fund_id , date and price I have 3 fields in the query: fund_id , date and price . So my query would go something like this: INSERT INTO funds (fund_id, date, price) VALUES (23,