avg<T> method

Future<T?> avg<T>(
  1. MssqlSession session,
  2. String column, {
  3. MssqlDialect dialect = MssqlDialect.sql2012,
})

AVG of column over the rows this query returns, or null for none.

Unbounded T for the same reason as sum. Note that SQL Server's AVG of an integer column is integer division; cast the column, or use the typed builder's avg(integers: …), if the fraction matters.

Implementation

Future<T?> avg<T>(
  MssqlSession session,
  String column, {
  MssqlDialect dialect = MssqlDialect.sql2012,
}) => _aggregate<T>(session, 'AVG', column, dialect);