37,720
社区成员
发帖
与我相关
我的任务
分享
a = '2019-04-09'
sql = """
select *
from
table
where substr(created_at,1,10) = %s
and substr(updated_at,1,10) = %s
"""
cursor.execute(sql,a)
a = '2019-04-09'
sql = """
select *
from
table
where substr(created_at,1,10) = '%s'
and substr(updated_at,1,10) = '%s'
"""
cursor.execute(sql,a)
或者这样
a = '2019-04-09'
sql = """
select *
from
table
where substr(created_at,1,10) = '%s'
and substr(updated_at,1,10) = '%s'
"""
cursor.execute(sql,(a,a,))