You have to use a subquery returning the tables primary key to the UPDATE:
UPDATE tab SET x=1 WHERE (primkey, col) IN ( SELECT primkey,col FROM tab ORDER BY col LIMIT 10) --------------------------------------------------------------------------- tp wrote: -- Start of PGP signed section. > Hi > > I want to SELECT at max. 10 rows and SET a variable for the > select 10 rows with the same query. > > Under mysql i can use: > UPDATE table SET uniq_iq=12345 LIMIT 10 > SELECT * FROM table WHERE uniq_id=1234; > > This is not supported by postgres. > > Is there some easy solution that does not require locking? > > > -tp -- End of PGP section, PGP failed! -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly