Hi
REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name [(col_name,...)]
VALUES ({expr | DEFAULT},...),(...),...
Or:
REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name
SET col_name={expr | DEFAULT}, ...
Or:
REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name [(col_name,...)]
S
Is there an easy way to overwrite a row (e.g. using replace) if a duplicate key
already exists?
For instance, is there something like ON DUPLICATE KEY REPLACE (as opposed to
UPDATE)?
Or do I have to:
key_exists = query database for key
if (key_exists){
REPLACE...
}
else{
INSERT...
}
T