Java tutorial
//package com.java2s; import android.provider.BaseColumns; public class Main { public static String increment(boolean increment, String table, String column, long _id) { return new StringBuilder("UPDATE ").append(table).append(" ").append(" SET ").append(column).append("=") .append(column).append(increment ? "+1" : "-1").append(" WHERE ").append(BaseColumns._ID) .append("=").append(_id).toString(); } }