代码如下:
sql = "select to_char(f_date at time zone 'GMT-8', 'YYYY-MM-DD
HH24:MI:SS') as f_date, f_open, f_close, f_high, f_low, f_volume
from choice_kwindminutefinancehistory
INNER JOIN choice_financecode
ON choice_kwindminutefinancehistory.f_code_id=choice_financecode.id
where choice_financecode.f_code = '" + stock + "'
AND f_date >='" + start_date + "' and f_date<='" + end_date + "'"
df = pd.read_sql_query(sql, con=self.engine)
这一切都很好,我从查询中得到了一个数据帧,但是当我更改SQL(又添加了两个内部联接)时,如下所示:
^{pr2}$我有一个空的数据帧。然后我在屏幕上打印SQL,复制并粘贴到DataGrip上,SQL起作用了,它可以返回行,但在程序中,使用read_sql_query()
返回空,我不知道为什么。在
目前没有回答
相关问题 更多 >
编程相关推荐