0
import MySQLdb

我实际上是在尝试使用包含 id 和日期的 where 子句进行选择valbars此语法对于传递日期是否正确?

 def get_bars(foo_id,cr_date):
    cursor = mysql.cursor()
    cursor.execute("""select val from bars where foo_id = %s and cr_date = %s""", (foo_id, cr_date))
    row = cursor.fetchone()
4

0 回答 0