On Sybase ASE, avg() function returns a value in the type of the parameters

Description

JPA specification ask avg() should return Double.

In Reference Manual:
When you average (signed or unsigned) int, smallint, tinyint data, Adaptive Server returns the result as an int value.

But considering it as an ASE feature, it won't be fixed.

causes

Activity

Brett MeyerMarch 7, 2014 at 5:31 PM

Bulk closing rejected tickets in "resolved" state.

Strong LiuJuly 11, 2011 at 10:28 AM

for example:

ID

VALUE

1

1

2

2

Double avgValue = (Double)session.createQuery("select avg(t.value) from Table t").uniqueResult();

mysql : avgValue == 1.5
sybase : avgValue == 1

Won't Fix

Details

Assignee

Reporter

Affects versions

Priority

Created July 11, 2011 at 9:06 AM
Updated March 7, 2014 at 5:31 PM
Resolved July 11, 2011 at 10:28 AM

Flag notifications