Sql statement if exists statement execution error report is very inexplicable. I hope you can take a look at it.

sql judges if exists to report an error

when updating database data

ifiu= "if exists (select food_rank from config_battle where food_rank=" + cb.getFood_rank () + ")" + update+ "else" + insert;

update and insert are two separate sql statements, one is to modify and the other is to delete

Dec.15,2021

MySQL should be written as insert-on-duplicate. Reference document https://dev.mysql.com/doc/ref.

Menu