如何修复“无结果可获取”

时间:2019-06-01 18:23:28

标签: mysql sql django python-3.x

我试图在数据库上运行一些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_

0 个答案:

没有答案