Insert record only if it does not exist in table without unique index
Reference: http://stackoverflow.com/questions/3164505/mysql-insert-record-if-not-exists-in-table/#3164741 Supposing we have a database table named distributor and we wish to insert a record only if there is no existing record with the same name and country code. The table only has a PRIMARY key but no UNIQUE index on (name, country_code) – think “legacy” and “no privileges to modify database” 😛 …
Continue reading “Insert record only if it does not exist in table without unique index”