Postgresql 更新备忘

关于Postgresql很好用的联合查询更新
BEGIN;
UPDATE s_ads_imprs_stats SET impressions = b.impressions  FROM tmp_ads_stats b WHERE s_ads_imprs_stats.crdate::date = b.dates AND s_ads_imprs_stats.crdate::date = '2009-02-25' AND s_ads_imprs_stats.ad_id = b.ad_id AND s_ads_imprs_stats.data_platform = b.data_platform;
COMMIT;

你可能感兴趣的:(PostgreSQL)