Learn XQuery |
Home:Learn XQuery:White Papers:Generating SQL:Sorting Data Sorting DataDataDirect XQuery® leverages the database for sorting, because the database can leverage indexes to sort much more efficiently. Example 5. Order By PushdownThe XQuery uses the Order By clause to sort database data in the database. XQuery for $u in collection('USERS')/USERS
Generated SQL SELECT ALL Example 6. Order By Pushdown - empty leastDataDirect XQuery® supports all variants of Order By in XQuery, pushing them down to the database. For instance, here is the SQL generated for a query that uses the empty least clause. XQuery for $u in collection('USERS')/USERS
Generated SQL (Oracle 10gR2) SELECT ALL Example 7. Sorting empty greatest on Microsoft SQL ServerIn some cases, supporting an XQuery sort order requires some ingenuity. For instance, Microsoft SQL Server does not support sorting NULL high, so we use a simple trick to implement empty greatest for this database efficiently, while still correctly implementing the semantics of XQuery. XQuery for $u in collection('USERS')/USERS
Generated SQL (SQL Server) SELECT ALL |
Try DataDirect XQuery® Free!Put the power, scalability, and performance of DataDirect XQuery® to work for you today! Our free trial lets you see for yourself how easy it is to build data integration applications that access relational, EDI, and other file formats as XML! Online Video Tutorials!Our easy-to-follow online video tutorials are a great way to get acquainted with the many features of DataDirect XQuery®. And if you like what you see, download a free copy today and try DataDirect XQuery® for yourself! Back to School with DataDirect XQuery®Getting your mind around the possibilities of a data integration technology as promising as XQuery can be difficult, but our XML developers Webinars will help you understand the power and versatility of XQuery, and our favorite XQuery processor, DataDirect XQuery®. Stay Informed!XQuery is one of the hottest XML technologies being developed today. Stay informed with vital news about standards, tools, and trends by signing up for the DataDirect XQuery® newsletter. |





