db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Pissarenko" <dmitri.pissare...@gmail.com>
Subject Sum of time
Date Tue, 17 Jul 2007 07:57:31 GMT
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/

Mime
View raw message