v.21.9New Feature
Allow Constant Expressions in Aggregate Function Parameters
Allow using constant expressions from with and select in aggregate function parameters. Close #10945. #27531 (abel-cheng).
Why it matters
This feature enables users to simplify queries by using constants defined earlier in the query within aggregate function parameters. It solves the limitation where aggregate functions could not accept constant expressions fromWITH or SELECT clauses, enhancing query flexibility and readability.How to use it
Define constant expressions in theWITH clause or as part of the SELECT list, and then use these constants directly as parameters inside aggregate functions within the same query.