Results 1 to 6 of 6

Thread: important

  1. #1
    Join Date
    Oct 2011
    Posts
    4

    Post Unanswered: important

    i am a new in sql and i wrote a code but i have a problem and i cannot fixed it
    my code:
    select to_char(date1,'MM-YYYY') "Monthly Date",
    sum(case when called_number like '010%' then count(called_number)
    end) "Vodafone",
    sum(case when called_number like '012%' then count(called_number)
    end) "Mobinil",
    sum(case when called_number like '02%' then count(called_number)
    end) "Land Line"
    from task1
    group by to_char(date1,'MM-YYYY')
    order by to_char(date1,'MM-YYYY') ;


    i need to not make called_number in group by and i need to count all calls from vodafone in each month,and so on

  2. #2
    Join Date
    Oct 2011
    Posts
    4
    ORA-00937: not a single-group group function
    this is my error

  3. #3
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    1. ORA are Oracle errors. This is a SQL Server forum
    2. You should use Google.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  4. #4
    Join Date
    Oct 2011
    Posts
    4
    i cannot understand you , why google???

  5. #5
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    ORA-00937: not a single-group group function

    this URL explains why you get the error.
    Cheers....

    baburajv

  6. #6
    Join Date
    Oct 2011
    Posts
    4
    i know that,
    now i have solved it , by get count(case and delete count inside) like this
    count(case when called_number like '010%' then called_number
    end) "Vodafone",
    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
  •