cursor.execute 执行两个结果并存储给变量

#当使用 cursor.execute 执行两个结果时,可以将这两个结果存储到两个不同的变量中。例如:

cursor.execute("SELECT * FROM table1")
result1 = cursor.fetchall()

cursor.execute("SELECT * FROM table2")
result2 = cursor.fetchall()

你可能感兴趣的:(sql,数据库,java)