XMLAGG()

Aggregate. Returns a single XML result aggregated over a group of rows.

Syntax

XMLAGG( expression )
Parameter

expression

An expression that evaluates to an XML value.

Data Types

Return

expression

XML

XML

Usage

All results are concatenated (ignoring Nulls). Note that windows are not required with XMLAGG.

See Also

Example

The following example shows the construction of an element called "orders", where the children of orders are "orderid" elements, one of each from each resulting row of the join:

INSERT INTO OutStream
SELECT XMLELEMENT("orders",
    XMLAGG(XMLELEMENT("orderid", orders.orderid)))
FROM Orders KEEP 1 HOUR, Shipments;