Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.11.0) with SMTP id e9QKlpU18005 for ; Thu, 26 Oct 2000 16:47:52 -0400 (EDT) (envelope-from pgsql-sql-owner@hub.org) Received: from alf.zfn.uni-bremen.de (alf.zfn.uni-bremen.de [134.102.20.22]) by hub.org (8.10.1/8.11.0) with ESMTP id e9QFOmU97981 for ; Thu, 26 Oct 2000 11:24:51 -0400 (EDT) (envelope-from umehlig@uni-bremen.de) Received: from tnt116.zfn.uni-bremen.de (tnt116.zfn.uni-bremen.de [134.102.7.116]) by alf.zfn.uni-bremen.de (8.9.1a/8.9.1/ZfNServer) with ESMTP id RAA135112 for ; Thu, 26 Oct 2000 17:21:02 +0200 Received: (from umehlig@localhost) by pandora3.vmnet.localnet (8.9.3/8.9.1) id RAA03321; Thu, 26 Oct 2000 17:24:28 +0200 From: Ulf Mehlig X-Authentication-Warning: pandora3.vmnet.localnet: umehlig set sender to umehlig@pandora3.vmnet.localnet using -f MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14840.19627.816771.43293@pandora3.vmnet.localnet> Date: Thu, 26 Oct 2000 17:24:27 +0200 (CEST) To: pgsql-sql@postgresql.org Subject: "average" time X-Mailer: VM 6.75 under Emacs 20.4.1 Reply-To: Ulf Mehlig Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/251 X-Sequence-Number: 1918 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 Center for Tropical Marine Ecology/ZMT, Bremen, Germany -----------------------------------------------------------------------