UPDATE query based on a SELECT command.

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: UPDATE query based on a SELECT command.
Date: 2012-01-28 18:54:30
Message-ID: CAAY=A79WB87A2C9kxKbLZh3LDkZrxoO+-R2AoejnZB5D2Wmp4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Let's suppose that I have an UPDATE query which includes a SELECT as part
of it as follows:

UPDATE table1
SET field1 = (SELECT fieldx FROM table2 WHERE .........)

What happens if the result of the SELECT command does not return any row?

Respectfully,
Jorge Maldonado

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2012-01-28 19:12:44 Re: UPDATE query based on a SELECT command.
Previous Message Craig Boyd 2012-01-28 18:08:45 Re: [personal] Re: PostgreSQL v8 & v9 on the same XP machine