Posted By

lostumbrellas on 08/16/11


Tagged

update join postgres


Versions (?)

SQL Update With Join


 / Published in: SQL
 

  1. UPDATE asset_class_allocations
  2. SET to_date = '2011-07-01'
  3. FROM asset_allocation aa
  4. JOIN options o ON aa.option_uid = o.uid
  5. JOIN product p ON o.product_uid = p.uid
  6. WHERE p.product_id IN (817,617)
  7. AND asset_class_allocations.to_date = '2011-06-30'
  8. AND asset_class_allocations.allocation_uid = aa.uid;

Report this snippet  

You need to login to post a comment.