【发布时间】:2020-04-09 06:57:43
【问题描述】:
**当我在查询下方运行时**
从 sqlalchemy 导入 create_engine
导入 pymysql
将熊猫导入为 pd
导入日期时间
db_connection_str = 'mysql+pymysql://root:*****@localhost/northwind'
db_connection = create_engine(db_connection_str)
df = pd.read_sql('SELECT * FROM employees where BirthDate between '1948-12-08' and '1960-05-29'', con=db_connection)
df
**我收到以下错误**
文件“”,第 7 行
df = pd.read_sql('SELECT * FROM employees where BirthDate between '1948-12-8' and '1960-5-29'', con=db_connection)
^
SyntaxError:无效的语法
-------------------------------------------------- ------------------------------------------------
【问题讨论】: