Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    18

    Unanswered: SQL *PLUS query problem

    Hi all,

    The following query is giving me problems:

    select teacherid,count(roleid) as headcount from tour_teacher where roleid=1 and count(roleid)>1

    The problem is with the 'count(roleid)>1' part of the query and returns the error:

    ERROR at line 1:
    ORA-00934: group function is not allowed here


    Any help would be much appreciated

    Regards

    Greg

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    select teacherid,count(roleid) as headcount
    from tour_teacher
    where roleid=1
    group by teacherid
    having
    count(roleid)>1;

Posting Permissions

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