I want to add a row to a database table, but if a row exists with the same unique key I want to update the row.
For example:
In case, you want to keep old field (For ex: name). The query will be:
INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE name=name, age=19;