Skip site navigation (1) Skip section navigation (2)

UPDATE with JOIN

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: UPDATE with JOIN
Date: 2005-05-24 18:02:40
Message-ID: 20050524175811.M92003@narrowpathinc.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi All,

I am banging my head againset the wall trying to figure out how to do a JOIN
within an UPDATE.  Can someone please help me out?  Here is what I have.  Of
course it does not work. :-(

UPDATE tbl_line_item
   SET tbl_line_item.reviewed = TRUE
  FROM tbl_item
    ON ( tbl_line_item.item_id = tbl_item.id )
 WHERE item_type = 'DIR';

Kind Regards,
Keith

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2005-05-24 18:26:21
Subject: Re: UPDATE with JOIN
Previous:From: Bruno Wolff IIIDate: 2005-05-24 17:20:20
Subject: Re: "NOT NULL"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group