我试图在数据库上运行一些sql查询以使用结果,但我一直在获取“无结果集可从中获取”。问题可能在哪里?
运行代码时,我被定向到以下行;
mycursor=mydb.cursor()
mycursor.execute=("""SELECT SUM(games) games
FROM (SELECT Count(*) games
FROM `results` WHERE HTgoals>ATgoals AND Home_team='{0}'
UNION SELECT COUNT(*) games FROM `results`
WHERE ATgoals>HTgoals AND Away_team='{0}') T""" .format(home_team))
_Home_team_Total_wins= mycursor.fetchall() #Home team total wins_