Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    12

    Post Unanswered: counting the occurances

    Hello All,

    I would like to count the number occurances of the values in a specific coulmn.

    Here is the table structure:

    Table Name: Plant_Outage

    Coulmn1: Plantid
    Column2: start_time
    Column3: end_time

    Column1 (Palntid) contains multiple entries. I want to get the plantid which occurs more than once. This is the requirement.

    Could some one advise how do I get this?

    Thanks in advance,
    Des

  2. #2
    Join Date
    Mar 2004
    Location
    Concord, MA
    Posts
    27

    Re: counting the occurances

    Originally posted by dessri
    Hello All,

    I would like to count the number occurances of the values in a specific coulmn.

    Here is the table structure:

    Table Name: Plant_Outage

    Coulmn1: Plantid
    Column2: start_time
    Column3: end_time

    Column1 (Palntid) contains multiple entries. I want to get the plantid which occurs more than once. This is the requirement.

    Could some one advise how do I get this?

    Thanks in advance,
    Des

    try this ... hope this will help...

    select plantid
    from Plant_Outage
    having count(plantid) > 1
    ~bagchi

  3. #3
    Join Date
    Feb 2004
    Posts
    12

    Re

    Hi Bagchi,

    This query (select plantid from Plant_Outage having count(plantid) > 1) returns me an error ORA00937 not a single-group group function.

    Any idea?

    Thanks,
    Des

  4. #4
    Join Date
    Mar 2004
    Location
    Concord, MA
    Posts
    27
    i missed the group by clause

    pls add 'group by plantid' at the end.....
    ~bagchi

  5. #5
    Join Date
    Feb 2004
    Posts
    12
    Yes.. It is working. Thanks a lot..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •