嗨,我有一个查询,我需要通过匹配两个值来更新数据库,我使用下面的代码
for i in getDailyGame :
query2 = "UPDATE Game_mygame SET game_played = "+str(set_game_played)+" WHERE home_teamID = "+str(i.home_teamID)+ " AND away_teamID = "+str(i.away_teamID)
cursor2.execute(query2)
大约有 4000 个条目要更新,但是如果是的话,我可以使用 F 类来更新它需要很长时间,而不是请建议如何使用它,比如
myplayer.objects.update(age=F('age')+0.0192)
谢谢