|
|
Subject: |
help with a select statement, and count() |
From: |
Harlan |
Date: |
3/16/1999 9:34:21 AM |
IP: |
206.222.20.2 |
Ok, I need to pull lots of information about a
test, from 4 different tables. Here comes the
problem, I need to get the number of times
a column (value), holds a number. An example of what I need is. value=1, 5 times and value>1, 10 times. But it all must be done in one sql statement, I can't select multiple times. Here is the sql I have so far, it doesn't allow for this, and I can't figure out how to do it.
sqlTest = "SELECT t.name, t.classid, c.timeallowed, c.passpercent, " & _
"c.totalquestions, c.percenthigh, c.active, " & _
"count(qa.testID) countQuestions " & _
"FROM tests t, class c, question_answer qa, questions q " & _
"WHERE t.testid=c.testid " & _
"AND qa.testid=t.testid " & _
"AND t.testid=" & intTestID & _
"group by t.name, t.classid, c.timeallowed, c.passpercent, " & _
"c.totalquestions , c.percenthigh, c.active"
btw, this is oracle 7. I'm not great at sql, other then simple selects, so any help would be nice. Thanks |
Follow Up - Re: help with a select statement, and count() - Harlan 3/19/1999 10:06:48 AM
|
|