ora-00904 invlaid identifer

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
vamsibatAsked:
Who is Participating?
 
awking00Connect With a Mentor Commented:
It needs to be having count(*) = 1.
0
 
ravindran_eeeConnect With a Mentor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.