Generates an XML type value from the concatenation of values from a collection of rows values where each row of the argument specifies the XML type.
XMLAGG ( value-expression |
Specifies the concatenated XML type value expression.
The following can be specified:
This format is supported only for compatibility with ISO standards. It has no effect on the format of the value of the concatenation result.
For details about other rules, see the rules in 2.14 Set functions.
From the bookinfo column of every row of BOOK_MANAGEMENT_TABLE, retrieve book information of the same category as the book whose title is SQL Explained.
SELECT XMLSERIALIZE(
XMLQUERY(
'$BOOKS/bookinfo[category=$BOOKS/bookinfo[title="SQL Explained"]/category]'
PASSING BY VALUE XMLAGG(bookinfo) AS BOOKS
RETURNING SEQUENCE BY VALUE EMPTY ON EMPTY)
AS VARCHAR(32000))
FROM BOOK_MANAGEMENT_TABLE