I need to update a row of rows in a table, if the update row does not exist in the table, I need to insert this row. I cannot use a unique key, therefore it is not recommended to use ON duplicate KEY UPDATE
I need to achieve something like this
DECLARE count DOUBLE; SELECT count(uid) INTO count FROM Table WHERE column1 ='xxxxx' AND column2='xxxxx'; IF (count=0) THEN
This is for a high performance application. Any ideas? Code level or query level
FYI: Database - Mysql
source share