agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Jie Liang <jliang@ipinc.com>
Cc: pgsql-sql@postgresql.org
Subject: select ... for update
Date: Tue, 12 Dec 2000 14:03:17 -0800
Message-ID: <3A36A0A5.E778EECA@ipinc.com> (raw)
References: <Pine.BSF.4.21.0012121033570.25667-100000@jliang.ipinc.com>
> Hi,
How can I use select ... for update to update limit to update what I
select??
somewhat like:
select url,id from mytable for update order by priority,id limit 5;
I want update the id in above return like:
update mytable set allocatedto='whatever' where id in above return set.
Could I do it in one stmt.
And what is class_name in following:
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
expression [ AS name ] [, ...]
[ INTO [ TEMPORARY | TEMP ] [ TABLE ] new_table ]
[ FROM table [ alias ] [, ...] ]
[ WHERE condition ]
[ GROUP BY column [, ...] ]
[ HAVING condition [, ...] ]
[ { UNION [ ALL ] | INTERSECT | EXCEPT } select ]
[ ORDER BY column [ ASC | DESC | USING operator ] [, ...] ]
[ FOR UPDATE [ OF class_name [, ...] ] ]
LIMIT { count | ALL } [ { OFFSET | , } start ]
can any one give me a example??
--
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang@ipinc.com
www.ipinc.com
view thread (17+ messages) latest in thread
Message-ID: <3A36A0A5.E778EECA@ipinc.com>
Permalink: ../3A36A0A5.E778EECA@ipinc.com/
Also on: postgresql.org/message-id/3A36A0A5.E778EECA@ipinc.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jliang@ipinc.com
Subject: Re: select ... for update
In-Reply-To: <3A36A0A5.E778EECA@ipinc.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox