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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Aggregatfunktion First



Hi Bernd,

einmal 'first' aus meiner Repository:

CREATE FUNCTION agg_first (state anyelement, value anyelement) RETURNS
anyelement
    AS '
BEGIN

    IF (state IS NULL) THEN
        RETURN value;
    ELSE
        RETURN state;
    END IF;

END;
'
    LANGUAGE plpgsql IMMUTABLE;

CREATE AGGREGATE "first" (
    BASETYPE = anyelement,
    SFUNC = agg_first,
    STYPE = anyelement
);

hth
Tobias

WIESECKE Bernd <BWiesecke(dot)gre(at)gauff(dot)com> wrote:
> Gibt es eigentlich eine "First" Funktion in PG für die Aggregation.
> Bekomme immer die Meldung unbekannt.
> Brauche aber aus jeder in "Group By..." definierten Gruppe die Werte
> mehrerer Felder eines DS in dem der Max.Wert gefunden wurde. Wollte
> also sortieren,gruppieren und den 1.DS jeder Gruppe verwenden.
> Eine Idee wäre hilfreich
>
>
>
> Mit freundlichen Grüßen
>
> Bernd Wiesecke
>
>
> ---------------------------(end of
> broadcast)--------------------------- 
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo(at)postgresql(dot)org so that
>        your message can get through to the mailing list cleanly




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group