Query structure
Select
The SELECT statement queries the contents. The WHERE clause filters the content using a qualification.
select * from <Content type> where <qualification>
select * from documents where <qualification>
Note: for now, you cannot choose the metadata to obtain. You must use * in the SELECT part.
The ORDER BY keyword can be used to sort the results at the end of the SELECT clause.
select * from <content type> where <qualification>
order by <metadata1>[asc|desc], <metadata2>[asc|desc]...
You can sort in ascending (ASC) or descending (DESC) order. If you do not specify a sort order, the default sort is ascending.
select * from documents where standard.status is not null order by standard.status asc, core.object_type desc
Note: the ORDER BY keyword must not be used when composing queries for the collections. The content list of the room has its own way of handling the order.