withAvgTruncating<TChild, V> method

MssqlProjectedQuery<(TRow, V?)> withAvgTruncating<TChild, V>(
  1. MssqlRelation<TRow, TChild> relation(
    1. TFields fields
    ),
  2. MssqlExpression operand
)

Parent rows plus AVG of operand with SQL Server's own integer rule kept: the remainder of an integer column is discarded.

For a whole-unit average where the fraction is noise. Use withAvgExact when it is not.

Implementation

MssqlProjectedQuery<(TRow, V?)> withAvgTruncating<TChild, V>(
  MssqlRelation<TRow, TChild> Function(TFields fields) relation,
  MssqlExpression operand,
) {
  return _withAggregate(
    relation,
    MssqlAggregate.avg(operand, integers: MssqlIntegerAverage.truncating),
    (v) => _decodeAggregate<V>('withAvgTruncating', v),
  );
}