Re: example of aggregate function for product
От | Alvaro Herrera |
---|---|
Тема | Re: example of aggregate function for product |
Дата | |
Msg-id | 20090624230450.GG16227@alvh.no-ip.org обсуждение исходный текст |
Ответ на | example of aggregate function for product (Whit Armstrong <armstrong.whit@gmail.com>) |
Список | pgsql-general |
Whit Armstrong escribió: > Ansis <ansis_no_ AT inbox.lv>13 Jan 2006 16:41:05 > An aggregate multiplication function, an analog of "sum" (the same > should be defined also for other numeric types): > > CREATE OR REPLACE FUNCTION mul2(FLOAT,FLOAT) > RETURNS FLOAT AS ' > DECLARE > a ALIAS FOR $1; > b ALIAS FOR $2; [...] > but that example looks pretty different than the ones found in the 8.3 > manual (avg for instance): The main difference is that the 8.3 docs example piggybacks on C language functions that you must compile and install separately, whereas the comment function uses a plpgsql function and is self-contained. Other than that (and the fact that the second one is for averages not multiplication), both examples are technically identical ... -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-general по дате отправления: