dsajkdadsa14222 2015-09-16 10:16
浏览 102
已采纳

如何更新多个字段

I have a table called users .

Users {name, team_id, overall_user_score}

I want to select all from a team (eg all from team 2) and add 1 to each users overall score taking into account the current score of each user.

I have the first part of the MySQL done, But I cant figure out how to actually update the score.

SELECT * from users WHERE team_id = $team UPDATE overall_user_score
  • 写回答

2条回答 默认 最新

  • dshmvqnl98119 2015-09-16 10:24
    关注

    Here is the correct SQL Query for updating.

    UPDATE `users` SET `overall_user_score`=`overall_user_score`+1 WHERE team_id= "'.$team.'"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码
  • ¥50 silvaco GaN HEMT有栅极场板的击穿电压仿真问题