"average" time

Поиск
Список
Период
Сортировка
От Ulf Mehlig
Тема "average" time
Дата
Msg-id 14840.19627.816771.43293@pandora3.vmnet.localnet
обсуждение исходный текст
Список pgsql-sql
Hello out there,

an ignorant's question: can I/how can I create an aggregate that
performs this operation on a group of timestamp values:
   select some_column,          min(timest)+(max(timest)-min(timest))/2    from mytable   group by some_column;

that is, an aggregate which calculates the point half way between the
minimum and the maximum of the time series? I would like to use it
like this (substitute something appropriate for "median", I don't have
an idea how to call it):
   select some_column, median(timest)   from mytable   group by some_column;

Any suggestions appreciated!
Regards,
Ulf

-- 
=======================================================================Ulf Mehlig    <ulf.mehlig@zmt.uni-bremen.de>
        Center for Tropical Marine Ecology/ZMT, Bremen, Germany
 
-----------------------------------------------------------------------


В списке pgsql-sql по дате отправления:

Предыдущее
От: Sandis Jerics
Дата:
Сообщение: HELP! ... pg_locale ???
Следующее
От: "Pitot"
Дата:
Сообщение: Nested Aggregate fonction & gouping attributes