MIN() GROUP BY ...

All functions > GROUP BY > MIN() GROUP BY ...

Returns the minimum value in the group.

Syntax

Diagram(
  Sequence(
    Terminal("MIN"),
    Terminal("("),
    NonTerminal("expr"),
    Terminal(")"),
    Choice(0, Skip(),
      Sequence(
        Terminal("FILTER"),
        Terminal("("),
        Terminal("WHERE"),
        NonTerminal("condition"),
        Terminal(")")
      )
    ),
    Choice(0, Skip(),
      Sequence(
        Terminal("GROUP BY"),
        OneOrMore(NonTerminal("feature"), Terminal(","))
      )
    )
  )
)
ParameterTypeRequiredDescription
exprTYesThe expression to find the minimum value of
conditionBOOLEANNoThe condition to filter the values before aggregation
featureFEATURENoThe features to group by (many features are supported)

Notes

  • Returns the smallest value in the group
  • Works with numeric, string, and date types
  • NULL values are excluded from the calculation
  • Returns NULL if all values are NULL or group is empty
  • With num_values parameter, returns an array of the N smallest values
  • Can be used with WHERE clause to filter before aggregation
  • Can be used with GROUP BY clause for grouped aggregation
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19