Re: Setting a default value for a select statement without results - Mailing list pgsql-sql

From Anton Gavazuk
Subject Re: Setting a default value for a select statement without results
Date
Msg-id -1442825864597553886@iso-8859-1msgid
Whole thread Raw
In response to Setting a default value for a select statement without results  (JORGE MALDONADO <jorgemal1960@gmail.com>)
List pgsql-sql
Hi Jorge,

Look on http://www.postgresql.org/docs/8.1/static/functions-conditional.html

Thanks,
Anton

On Feb 6, 2013, at 0:23, JORGE MALDONADO <jorgemal1960@gmail.com> wrote:

> I have an UPDATE query with the following general structure:
>
> UPDATE table1 SET (SELECT field FROM table2 WHERE conditions ORDER BY order_field LIMIT 1)
>
> Is it possible to assign a default value in case no results are returned by the SELECT statement?
>
> Respectfully,
> Jorge Maldonado



pgsql-sql by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Setting a default value for a select statement without results
Next
From: Dev Kumkar
Date:
Subject: Re: Querying multiple database