From: Loredana Curugiu <loredana.curugiu@gmail.com>
To: dev@archonet.com
To: andreas.kretschmer@schollglas.com
To: pgsql-novice@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Select last there dates
Date: Thu, 21 Jun 2007 16:00:05 +0300
Message-ID: <1c23c8e70706210600he74293ci83bdbc557ee2dba8@mail.gmail.com> (raw)
In-Reply-To: <20070621095025.GG1405@a-kretschmer.de>
References: <1c23c8e70706210118h6b9490e3s11e2a6ba15cdff6c@mail.gmail.com>
<20070621095025.GG1405@a-kretschmer.de>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: loredana.curugiu@gmail.com, dev@archonet.com, andreas.kretschmer@schollglas.com, pgsql-novice@postgresql.org
Subject: Re: [SQL] Select last there dates
In-Reply-To: <1c23c8e70706210600he74293ci83bdbc557ee2dba8@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox