My Oracle Support Banner

Sort on Output of Query (With Distinct) Results into ORA-904 on "DISTINCT" (Doc ID 1627585.1)

Last updated on FEBRUARY 26, 2019

Applies to:

Oracle SQL Developer - Version 4.0 and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Information in this document applies to any platform.

Symptoms

The query "select distinct deptno, d.* from dept d" produces correct output in SQL Worksheet.
However, when sorting the "query output"  by clicking on a column header, the following error occurs:
ORA-00904: "DISTINCT": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.