Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    1

    Unanswered: Need only certain information from a table

    The code
    Code:
    SELECT US.uno, COUNT(UR.response)/(SELECT MAX(Q2.qno)
    				   FROM question Q2
    				   WHERE Q2.eno = 3) AS Score
    FROM userResponse UR, question Q, users US, exam E
    WHERE UR.response = Q.correctAnswer
    AND UR.uno = US.uno
    AND UR.eno = Q.eno
    AND UR.qno = Q.qno
    AND UR.eno = 3
    AND UR.eno = E.eno
    GROUP BY US.uno;
    produces this table:


    UNO SCORE
    ---------- ----------
    1 .2
    2 .1
    3 .2

    I only want ones where the score is > .1.

    Is there a way I can work with the result table and only get the rows where score > .1?
    Last edited by deezy; 03-11-12 at 00:13.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
      1  select deptno, count(*) total from emp
      2  group by deptno
      3* having count(*) > 5
    20:22:26 SQL> /
    
        DEPTNO	TOTAL
    ---------- ----------
    	30	    6
    	20	    9
    
    20:22:28 SQL> select deptno, count(*) total from emp group by deptno;
    
        DEPTNO	TOTAL
    ---------- ----------
    	30	    6
    	20	    9
    	10	    3
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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