1
import datetime
from datetime import date
Start_Date = date(2010, 01, 01)
market = 1
Query_PNL = """SELECT rptday,extract(year from rptday),extract(month from rptday),a.botid,closetoclosepnl,
case when closetoclosepnl > 0 then 1
when closetoclosepnl < 0 then 0
END AS PNL_score
FROM RESEARCH.ADMIN.BOTSDAILYPNL a
--order by botid desc, rptday asc;
right join
(SELECT marketid,botid,modelid
FROM RESEARCH.ADMIN.BOTS
where modelid = 2018 and botname like '%BackTesting')b
on a.MARKETID = b.marketid and a.BOTID = b.botid
where a.rptday >='2010-01-01' and a.rptday <='2010-01-31' and a.MARKETID = %s and PNL_score is not null
order by rptday asc""" %(market)
print Query_PNL
おそらく '%BackTesting'の「%」のために... – alfasin
@alfasin:それは真実かもしれません、ただ実現しました。私は、クエリを再配置しようとし、再度実行されます。ありがとう –