Learn how to a build a cloud-first strategyRegister Now


ora-00904 invlaid identifer

Posted on 2009-02-17
Medium Priority
Last Modified: 2013-12-19
i am getting following error

ora-00904 "CNT' invalid identifer
select claim_header_sid, count(*) cnt   from ad_clm_hdr_condition  group by claim_header_sid having cnt =1;
is there any way to avoid this error  other than using inlineview
Question by:vamsibat
LVL 32

Accepted Solution

awking00 earned 1000 total points
ID: 23661212
It needs to be having count(*) = 1.
LVL 10

Assisted Solution

ravindran_eee earned 1000 total points
ID: 23663855
Proper query is

select claim_header_sid, count(*) cnt   from ad_clm_hdr_condition  group by claim_header_sid having count(*) =1;

It is not possible to use aliases in HAVING clause. Only aggregate functions can be used along with a condition in the HAVING clause.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question