Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

ORDER BY Element

CMISQL Element Grooper.CMIS

Specifies the order in which results from a CMISQL Query should be returned.

Remarks

The ORDER BY Element defines how the results of a CMISQL Query are sorted. Each element specifies a property to sort by and the direction of the sort. The ORDER BY clause is optional and can include one or more ORDER BY Elements, separated by commas, to support multi-level sorting.

The general syntax for an ORDER BY clause is:

ORDER BY <PropertyName> [ASC|DESC]
  • <PropertyName> is the query name of an orderable property.
  • ASC sorts from smallest to largest (ascending). This is the default if no direction is specified.
  • DESC sorts from largest to smallest (descending).

Sorting on Multiple Properties

To sort results on multiple columns, include multiple ORDER BY Elements separated by commas:

ORDER BY PropertyName1 DESC, PropertyName2 ASC

Example

The following query, when used with the NTFS binding, returns all PDF files with 'monthly report' in the filename, sorted in descending order by file size:

SELECT * FROM File WHERE FileExtension='.pdf' AND cmis:name LIKE '%monthly report%' ORDER BY cmis:contentStreamLength DESC

When configuring an ORDER BY Element, select the property to sort by and specify the sort direction as needed. Only properties marked as orderable in the CMIS Repository can be used. If an invalid property is selected, or the property is not orderable, validation errors will be reported.

The ORDER BY Element is a key part of building queries that return results in a meaningful and predictable order.

Properties

NameTypeDescription

Used By

Notification