1. 程式人生 > >> ERROR: column "createddate" of relation "trend" does not exist LINE 2: ...ays_on_market,selling

> 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中什麼時候新增""的問題