Name
DB.DBA.BAG_AGG — Returns a vector of passed values.
Synopsis
vector
DB.DBA.BAG_AGG
(
|
value_expression
any
) ; |
Description
DB.DBA.BAG_AGG()
returns a vector of passed values.
This is similar to DB.DBA.VECTOR_AGG() and returns a vector of passed values but the order of items in the vector is not predefined and may vary from run to run.
A query with DB.DBA.BAG_AGG()
may work faster than a similar query with
DB.DBA.VECTOR_AGG()
because DB.DBA.BAG_AGG()
gives more
freedom to the SQL optimizer. If the order is not important for your application, consider using of DB.DBA.BAG_AGG()
.
Parameters
value_expression
Value of item for aggregation.
Return Types
Any
Examples
Example 24.6. Simple Use
SELECT DB.DBA.BAG_AGG (subquery.X) FROM (SELECT X FROM ... ORDER BY X) as subquery