I have counter for unique column in my table. Now I have list where I have column name (which is unique) and counter (which contains some integer value). I know that it is possible to insert multiple lines, I just could make query containing all those items on the list, but problem is that if there is already data in unique field.
In that case there is already this name and it has counter value, in this case I need to sum existing counter value to added alue and update that row. Is there any way to make all this with one Sql query? I use MySQL database and Java.