Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLSyntaxErrorException: ORA-00904: “GROUPID”: invalid identifier

user10484841Jun 21 2012 — edited Jun 21 2012
I have this Oracle table:
CREATE TABLE USERGROUPS(
  GROUPID INTEGER NOT NULL,
  GROUPNAME VARCHAR2(40 ),
  GROUPSTATUS VARCHAR2(30 ),
  DATEGROUPADDED DATE,
  DATEGROUPLOCKED DATE,
  GROUPEXPIREDATE DATE,
  DESCRIPTION CLOB
)
/
I tried to run this SQL query:
SELECT c.*
FROM
  (SELECT b.*,
    rownum rn
  FROM
    (SELECT a.* FROM USERGROUPS a ORDER BY GROUPID ASC
    ) b
  WHERE rownum <= 5
  ) c
WHERE rn > 10
I get this error message in SQL developer when I run it:

ORA-00904: "GROUPID": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 5 Column: 25

I also tested this SQL query:
SELECT GROUPID FROM USERGROUPS 
I get this error:

ORA-00904: "GROUPID": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 1 Column: 7

Can you help me to fix the problem?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2012
Added on Jun 21 2012
3 comments
8,547 views