Results 1 to 3 of 3

Thread: Count ?

  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Unanswered: Count ?

    Hi, below tells me all of the students who have failed an exam

    select emark, surname, forenames from result, student
    where emark=0
    and result.netid = student.netid;

    im looking for the person who has failed six exams
    ive tried:

    select emark, surname, forenames from result, student
    where emark=0
    (select count( surname) where surname >6)
    and result.netid = student.netid;

    but no luck. Iv'e also tried distinct surname as well.
    Can someone point me in the right direction.

    Thanx

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Count ?

    select student.netid, count(*)
    from result, student
    where emark=0
    and result.netid = student.netid
    group by student.netid
    having count(*) >= 6;

  3. #3
    Join Date
    Feb 2004
    Posts
    4
    that does the trick,
    thanx alot.

Posting Permissions

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