我从一个SQL查询中得到一个值,它以max\u dateCS的名称存储。此变量需要输入到另一个SQL查询中。我面临这样做的问题,因为它会给出一个错误'列表索引超出范围'。你知道吗
query2 = """select max(date_hour) from mu_test_table1"""
cur.execute(query2);
conn.commit()
max_dateCS = cur.fetchall();
Query3= """select count (*) from mu_test_table1
where date_hour = %s;"""
cur.execute(Query3,(max_dateCS[0]));
conn.commit()
rows = cur.fetchall();
目前没有回答
相关问题 更多 >
编程相关推荐