The following examples show how the FOR XML clause can be used in a SELECT statement.
SELECT XMLELEMENT( NAME root, (SELECT * FROM Employees FOR XML RAW)); |
SELECT Name, AVG(UnitPrice) AS Price FROM Products GROUP BY Name FOR XML RAW; |
CREATE VIEW EmployeesDepartments AS SELECT Surname, GivenName, DepartmentName FROM Employees JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID FOR XML AUTO; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |