pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jasmin Dizdarevic <jasmin.dizdarevic@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Create custom aggregate function and custom sfunc
Date: Thu, 2 Jul 2009 16:48:50 +0200
Message-ID: <a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@mail.gmail.com> (raw)

 hi,

i have to create a aggregate function which evaluates a maximum text
value but with some conditions i have to take care of.
is there a way to access a value set of each group?
e.g.:

customer ; seg
111 ; L1
111 ; L2
111 ; L1
222 ; L3
222 ; L3
222 ; L2

the result should look like this:

111: L1 - because L1 is higher than L2 and ratio of L1 : L2 is 2 : 1
222: L3 - because L3 is higher than L2 and ratio of L3 : L2 is 2 : 1

i hope you know what i mean.

ty

view thread (5+ messages)  latest in thread

Message-ID: <a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@mail.gmail.com>
Permalink:  ../a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@mail.gmail.com/
Also on:    postgresql.org/message-id/a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@mail.gmail.com

 · 

reply

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: jasmin.dizdarevic@gmail.com
  Subject: Re: Create custom aggregate function and custom sfunc
  In-Reply-To: <a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@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