Skip site navigation (1) Skip section navigation (2)

Re: offset and limit in update and subselect

From: "Timothy H(dot) Keitt" <Timothy(dot)Keitt(at)SUNYSB(dot)Edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: offset and limit in update and subselect
Date: 2001-02-24 20:22:33
Message-ID: 3A981809.9050202@SUNYSB.Edu (view raw or flat)
Thread:
Lists: pgsql-hackers
I see this (subselect) is available in >=7.1.

Tim

Timothy H. Keitt wrote:

> Hi,
> 
> It appears that limit and offset do not work in a subselect such as:
> 
>     update my_table set my_col = new_val where oid = (select oid from 
> my_table offset row_number limit 1);
> 
> Basically, I need to update rows by offset from the beginning of the 
> table.  Even nicer would be
> 
>     update my_table set my_col = new_val offset row_number limit 1;
> 
> But this is not supported either.
> 
> Tim


-- 
Timothy H. Keitt
Department of Ecology and Evolution
State University of New York at Stony Brook
Phone: 631-632-1101, FAX: 631-632-7626
http://life.bio.sunysb.edu/ee/keitt/


In response to

pgsql-hackers by date

Next:From: Matthew KirkwoodDate: 2001-02-24 20:37:20
Subject: Re: A patch for xlog.c
Previous:From: Timothy H. KeittDate: 2001-02-24 20:08:17
Subject: offset and limit in update and subselect

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group