> ERROR: column "createddate" of relation "trend" does not exist LINE 2: ...ays_on_market,selling

在使用psycop2的时候遇到的问题:

这个问题还有一个相似的问题:

_insert_query = '''
        insert into trend(
        new_listings,homes_sold,average_days_on_market,selling_to_listing_price_ratio,city,createdDate)
         values(%s,%s,%s,%s,'%s',now())
'''%(item['new_listings'],item['homes_sold'],item['average_days_on_market'],item['selling_to_listing_price_ratio']
        ,str(item['city']))

就是关于%s的引号问题;

这里也是关于createdDate的引号问题;

下次将总结一下关于sql中什么时候添加""的问题

猜你喜欢

转载自blog.csdn.net/weixin_38859557/article/details/84999146