Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 76022 invoked from network); 17 Jul 2007 09:04:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2007 09:04:12 -0000 Received: (qmail 26974 invoked by uid 500); 17 Jul 2007 07:57:56 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 26813 invoked by uid 500); 17 Jul 2007 07:57:55 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 26802 invoked by uid 99); 17 Jul 2007 07:57:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 00:57:55 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dmitri.pissarenko@gmail.com designates 64.233.166.177 as permitted sender) Received: from [64.233.166.177] (HELO py-out-1112.google.com) (64.233.166.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 00:57:51 -0700 Received: by py-out-1112.google.com with SMTP id p76so2932141pyb for ; Tue, 17 Jul 2007 00:57:31 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mEbZ0yRWw5GhJ6NqDVrXQWDzpfscagPFC9RKLUjDLLMAGxvdQan5M9mY024Y1fqxQ+d6f4WEGIWqOnzUWrzXpJwnuYprCJqGRczZ5ZzUE588Oczk6qoBbA1Kj6323GViBQBd58XhWf8DKtkau4kOcs8ESQrcgHwOSTD4lMzMZzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CO0xE+53YDInQNrrGCrVBDHTpIBBH72vfwv1HWTefw+sTaQ3pAaCW/wLLOOPGndHSSUN/gXBb1II4j2qmuwhEHNwANaSCb9EY6n2Nz2mxwUgX8/YOA6sTrGvEJXoTj6t+4ZSq/k/6YWx6YifwPM4WtysF+XxeOHa1GVUYhp/g9c= Received: by 10.35.62.19 with SMTP id p19mr338616pyk.1184659051128; Tue, 17 Jul 2007 00:57:31 -0700 (PDT) Received: by 10.35.36.2 with HTTP; Tue, 17 Jul 2007 00:57:31 -0700 (PDT) Message-ID: Date: Tue, 17 Jul 2007 09:57:31 +0200 From: "Dmitri Pissarenko" To: derby-user@db.apache.org Subject: Sum of time MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hello! I have a table with with time fields. That is, each record has a) field "place" (string) and b) field "duration" (time). I want to run a query like this SELECT PLACE, SUM(DURATION) FROM MyTable GROUP BY PLACE But I'm getting following error message: SQL State = 42Y22 SQL Code = 30000 SQL Message = Aggregate SUM cannot operate on type TIME. Exception message = java.sql.SQLSyntaxErrorException: Aggregate SUM cannot operate on type TIME. How can I run this query (determine sum of duration per place) nevertheless? TIA Dmitri Pissarenko -- http://www.xing.com/profile/Dmitri_Pissarenko http://dapissarenko.blogspot.com/