Re: [SQL] Select last there dates

From: "Loredana Curugiu" <loredana(dot)curugiu(at)gmail(dot)com>
To: dev(at)archonet(dot)com, andreas(dot)kretschmer(at)schollglas(dot)com, pgsql-novice(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Select last there dates
Date: 2007-06-21 13:00:05
Message-ID: 1c23c8e70706210600he74293ci83bdbc557ee2dba8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Richard, Andreas,

thank you very much for your solutions. I took a look on
both solutions, but I choosed Andreas's solution because
is shorter :)

So Andreas, would you please give some more explanations
on your solution? I didn't work with functions and aggregate till
now.

I don't understand how this comma_aggregate works. I can see that this
function it is defined with two arguments, but the aggredate it is called
with a single argument.

And what is LANGUAGE sql IMMUTABLE STRICT ?

CREATE FUNCTION comma_aggregate(text,text) RETURNS text AS '
> SELECT CASE WHEN $1 <> '''' THEN $1 || '', '' || $2 ELSE $2 END; '
> LANGUAGE sql IMMUTABLE STRICT;
>
> CREATE AGGREGATE comma (basetype=text, sfunc=comma_aggregate, stype=text,
> initcond='' );
>
>

Best regards,
Loredana

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Huxton 2007-06-21 13:18:37 Re: Select last there dates
Previous Message Marcus Engene 2007-06-21 10:49:15 stem override, tsearch2

Browse pgsql-sql by date

  From Date Subject
Next Message Dani Castaños 2007-06-21 13:08:49 Re: Results per letter query
Previous Message A. Kretschmer 2007-06-21 11:12:06 Re: Results per letter query