ora-00904 invlaid identifer

Posted on 2009-02-17
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 31

    Accepted Solution

    It needs to be having count(*) = 1.
    LVL 10

    Assisted Solution

    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

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
    Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
    This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
    This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now