public class AvgWithArgumentCastFunction extends StandardAnsiSqlAggregationFunctions.AvgFunction
Some databases strictly return the type of the of the aggregation value for <tt>AVG</tt> which is problematic in the case of averaging integers because the decimals will be dropped. The usual workaround is to cast the integer argument as some form of double/decimal.
INSTANCE| Constructor and Description |
|---|
AvgWithArgumentCastFunction(String castType)
Constructs a AvgWithArgumentCastFunction
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
renderArgument(String argument,
int firstArgumentJdbcType) |
determineJdbcTypeCode, render, rendergetName, getRenderedName, getReturnType, getType, hasArguments, hasParenthesesIfNoArguments, toStringpublic AvgWithArgumentCastFunction(String castType)
Constructs a AvgWithArgumentCastFunction
castType - The type to cast the avg argument toprotected String renderArgument(String argument, int firstArgumentJdbcType)
renderArgument in class StandardAnsiSqlAggregationFunctions.AvgFunctionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.