Received: from thor.tht.net (thor.tht.net [209.47.145.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBCMacM03070 for ; Tue, 12 Dec 2000 17:36:38 -0500 (EST) (envelope-from jliang@ipinc.com) Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id SAA67393 for ; Tue, 12 Dec 2000 18:12:32 GMT (envelope-from jliang@ipinc.com) Received: from ipinc.com (jliang.ipinc.com [199.245.188.130]) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id OAA55421 for ; Tue, 12 Dec 2000 14:12:32 -0800 (PST) (envelope-from jliang@ipinc.com) Message-ID: <3A36A0A5.E778EECA@ipinc.com> Date: Tue, 12 Dec 2000 14:03:17 -0800 From: Jie Liang Organization: ipinc.com X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: select ... for update References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/93 X-Sequence-Number: 426 > 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