Re: [SQL] Simulating LIMIT/OFFSET in a subquery

2001-02-11 Thread Tom Lane
"Jamie Walker" <[EMAIL PROTECTED]> writes: > But of course, ORDER BY and LIMIT are not allowed in sub-queries. FWIW, they are allowed as of 7.1 ... regards, tom lane

[SQL] Contributing Documentation to PG

2001-02-11 Thread Roberto Mello
I finally came around to writing some extra documentation for PL/PgSQL (and maybe PL/Tcl) and how to do PL/SQL-to-PL/PgSQL porting. I downloaded the documentation sources, intending to use its nice configure/make scheme but I can't find the configure script as described in the curr

[SQL] Simulating LIMIT/OFFSET in a subquery

2001-02-11 Thread Jamie Walker
I need to write querys that return the second and third record from a 'visits' table, for each patient. (What I need to do is look at how many patients were diagnosed on the first/second/third visit to see a physician at the outpatient clinic). I can get at the first visit using DISTINCT ON: S

Re: [SQL] fetching the id of a new row

2001-02-11 Thread Richard Huxton
Albert REINER wrote: > > I do not know of a way to insert and select in one statement without > the use of a function (what's the problem with those, by the way?), > but as far as I can tell nextval() will return the next value for any > backend, so if you have more than one backend inserting at