When adding a row to a table, but first checking to see if it exists first Which would be the most efficient way of handling this?
Would it be a case of query to see if it exist, if not then insert.
Or using on duplicate?
Or simply replace (Would this work, if the row did not exist)?
Thanks
I think this is the fastest way in MySQL:
EDIT:
MySQL will delete the row if it does exist and insert a new one.