Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
← Back to SQLCODE Reference
Error

SQLCODE -208

ORDER BY column not in SELECT

Explanation

ORDER BY column not in SELECT list when DISTINCT is used.

Solution

Add the ORDER BY column to SELECT list or remove DISTINCT.

Example

SELECT DISTINCT NAME FROM EMP ORDER BY SALARY