query_sql = """
SELECT a.plateform_type, DATE_FORMAT(a.create_date, '%Y-%m-%d') the_date, COUNT(*) the_count FROM (
SELECT DISTINCT n.plateform_type, DATE_FORMAT(n.create_time, '%Y-%m-%d') create_date, n.shop_id FROM ncrm_login n
WHERE n.create_time>='%s' AND n.create_time<'%s' ) a
GROUP BY a.plateform_type, the_date
ORDER BY a.plateform_type, the_date;""" % (start_time, end_time)
unsupported format character 'Y' (0x59) at index 71
python中写SQL语句时遇到date_format(the_date, %Y-%m-%d)
与%s拼接sql语句时无法格式化,需要在%Y-%m-%d每个%前面再加一个%----date_format(the_date, %%Y-%%m-%%d)
;