我正在尝试从 MySQL (total_points) 中选择一个值,然后添加到一个局部变量 (new_points) 并在 SAME 查询中更新 total_points,有谁知道这是否可能......
我目前有.,
cursor = database.cursor()
cursor.execute("""SELECT total_points FROM g_ent WHERE e_id =%s AND user =%s;
UPDATE total_points = (total_points + %s)"""
,(e_id, user_name, new_points))
database.commit()