Received: from aslan.computas.no (aslan.computas.no [194.143.82.2]) by hub.org (8.8.8/8.7.5) with ESMTP id DAA06481 for ; Mon, 14 Sep 1998 03:32:22 -0400 (EDT) Received: from ENDEAVOUR ([194.143.82.141]) by aslan.computas.no (8.8.5/8.8.5) with ESMTP id JAA02993; Mon, 14 Sep 1998 09:32:19 +0200 (MET DST) Date: Mon, 14 Sep 1998 09:32:18 +0200 (MET DST) Message-Id: <199809140732.JAA02993@aslan.computas.no> From: "Sverre H. Huseby" To: pgsql-sql@postgresql.org Subject: Aggregate functions on DATE and TIME Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" As far as I can see, the aggregate functon MAX isn't defined for type TIME. I desperately need to extract the last sample for each day from a database, and tried this statement: SELECT MAX(time),date FROM samples GROUP BY date; where the table samples contains date DATE, time TIME, I get the following error: ERROR: function max(time) does not exist I've tried casting the time to a type for which MAX is defined, but I was unable to find a casting function that was valid. My questions are: Why isn't MAX defined for TIME? Will it be defined in the future (no news about it in the 6.4-BETA1 HISTORY-file)? Any alternative ways to get the result I want? Thanks for your time! Sverre. -- Work: shh@computas.no +47 67 55 52 69 Home: sverrehu@online.no http://home.sol.no/~sverrehu/