to_aggregate_state()

Converts a value into the aggregate state of the aggregate function with the given name and signature. The type of the value must exactly match the state layout of the aggregate function. An optional fourth argument supplies constant parameter values (e.g. string_agg's separator) as a list with one entry per argument, using NULL for arguments that are not bound to a constant.

Reference: DuckDB 2.0.0

Arguments & returns

3 overloads

to_aggregate_state(data, name, signature)

Scalar
Overload link datanamesignature Returns
#01 ANYVARCHARANY[] ANY

to_aggregate_state(data, name, signature, constant_parameters)

Scalar
Overload link datanamesignatureconstant_parameters Returns
#02 ANYVARCHARANY[]ANY ANY

to_aggregate_state(data, name, signature, constant_parameters, order_by)

Scalar
Overload link datanamesignatureconstant_parametersorder_by Returns
#03 ANYVARCHARANY[]ANYANY ANY

Example

to_aggregate_state example
SQL
Haybarn WASM 2.0.0-rc12 · In your browser

Engine example · Run to view results.