ORDER BY Clause

Use the ORDER BY clause to specify the order in which the records appear in a query.

Example:

"~FullName" ASC

(For a List in which the records are displayed in ascending order, by FullName. (The ASC and DESC keywords are optional—if neither is included, ASC is assumed.))

To sort the data by multiple fields, specify a comma-separated list:

Example:

"~RecordTime" DESC, "SeqNo" DESC

(For an Events List in which the records are displayed in descending order by both record time and the sequence in which events that have the same time stamp occurred.)

Whenever an alias is assigned to a field (see SELECT Clause), remember to specify that alias, rather than the field name, in the ORDER BY clause.

The GROUP BY clause—is a clause that you might want to consider using for producing complex queries.

Further Information

Restrictions that apply to queries used for GIS Map Markers: see Designing Queries for GIS Map Markers in the Geo SCADA Expert Guide to Mapping and Geographic Information.


Disclaimer

Geo SCADA Expert 2022