Re: multiple paramters in aggregate function

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: Scara Maccai <m_lists(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: multiple paramters in aggregate function
Date: 2009-08-18 04:51:30
Message-ID: 4A8A3352.7090401@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

That would be true if all units were always convertible to mm, but we
have volume also, we also have feet etc.. So that the easiest and
cleanest thing to do, with out having to throw the all the functions
into a case statement is an aggregate function that takes the 2 unit
types and then gives back a result.

> Well I don't think you got Alban's suggestion right...
> What he was trying to say was:
>
> - use a regular (not aggregated) function to convert all measures to mm
> - use the normal SUM() to sum those value
> - use another regular function to convert from mm to whatever
>
> select mm_to_m(sum(convert_to_mm(measure))) from a
>
> Which is easier than my solution

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2009-08-18 08:32:35 Re: comparing NEW and OLD (any good this way?)
Previous Message Andrew Bartley 2009-08-18 03:50:09 Re: Function Logging