Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

ORDER BY clause

  • Last Updated: May 12, 2026
  • 1 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

The ORDER BY clause is used to arrange the result set in an ascending or descending order.

Syntax

ORDER BY

Example

SELECT empno, deptno FROM emp WHERE deptno in (SELECT TOP 1 deptno FROM dept ORDER BY deptno);

Note: OpenAccess SDK returns an error if:

Note: OpenAccess SDK returns an error if The TOP clause is not specified in the subquery along with the ORDER BY clause.

Note: OpenAccess SDK returns an error ifORDER BY is specified in union subqueries. For example: SELECT TOP 1 deptno,empno FROM emp ORDER BY empno UNION SELECT deptno,divno FROM dept;

TitleResults for “How to create a CRG?”Also Available inAlert