Re: [SQL] problem with selecting from a function

2011-06-20 Thread Pavel Stehule
2011/6/21 Andreas : > Hi, > > I've got a table with a couple of objects. > Primary key object_id. > > There is a function that fetches some values from another table that relate > to an object_id. > Like   fctX ( 7 )  --> set of typX ... ( 14, 'bla' ), ( 17, 'blu' ), ( 21, > 'ble' ), ... > The resu

[SQL] problem with selecting from a function

2011-06-20 Thread Andreas
Hi, I've got a table with a couple of objects. Primary key object_id. There is a function that fetches some values from another table that relate to an object_id. Like fctX ( 7 ) --> set of typX ... ( 14, 'bla' ), ( 17, 'blu' ), ( 21, 'ble' ), ... The result of the function can have 0 or mo

Re: [SQL] Append n Rows into a Single Row

2011-06-20 Thread Ross J. Reedstrom
On Sat, Jun 18, 2011 at 08:51:55PM -0700, Samuel Gendler wrote: > Actually, you need the array_agg() function to aggregate multiple rows into > a single array, and that is discussed on the aggregate functions page, > here: http://www.postgresql.org/docs/9.0/static/functions-aggregate.html > > You

[SQL] Query to select nested comments sorted by nesting and date

2011-06-20 Thread Cstdenis
I am trying to select nested commentes from a table with this structure CREATE TABLE picture_comments ( comment_id serial NOT NULL, user_id integer NOT NULL, "comment" text NOT NULL DEFAULT ''::text, comment_date timestamp without time zone NOT NULL DEFAULT now(),

Re: [SQL] pagination problem in postgresql need help

2011-06-20 Thread Emi Lu
select aiah_number.aiah_number_id, aiah_number.aiah_number, ... order by rank_value desc limit 1 offset 1; I use: == select ... order by ... LIMIT #{pageSize}::INTEGER OFFSET #{offset}::INTEGER; Emi -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make