lundi 28 décembre 2015

SQL statement in Java to update a field only if the value is greater than the current one

What the title said. So far, I have this statement:

String query = "UPDATE Score SET Points = "+scorecard[TOTAL][i]+" WHERE Name = "+players[i].getName()+" AND Lastname = "+players[i].getLastName()";

Any idea how I should go about it? I saw somewhere to use the CASE WHEN syntax but couldn't make it work.

Aucun commentaire:

Enregistrer un commentaire