Hey thanks for your reply. I am still struggling with it
somewhat although I
have managed to get the task done. I think I need a good sql
server book -
any suggestions?
Rachael
>From: "Jeffrey Schoolcraft"
<jeffrey.schoolcraft gmail.com>
>Reply-To: AspNetAnyQuestionIsOk@yahoogroups.com
>To: AspNetAnyQuestionIsOk@yahoogroups.com
>Subject: Re: [AspNetAnyQuestionIsOk] procedure
interpreter required
>Date: Tue, 30 Jan 2007 08:27:02 -0500
>
>Let's start with the easy part:
>
>SELECT
> [QuizResultId],
> [EmployeeId],
> [QuizDate],
> [QuizId],
>( ) as AnsweredCorrect
>FROM
> [dbo].[QuizResult] qr
>WHERE
> [QuizResultId] = QuizResultId
>
>just a normal select, pulling 4 columns and something
else from QuizResult
>for the QuizResult you care about ( QuizResultId).
>
>That "something else" bit is a correlated sub
query, it's going out to grab
>the count of correct answers for a particular quiz
result, that particular
>quiz result happens to match qr.quizresultid that in
your main query you
>specified was quizresultid.
>
>you could look at this query individually, just
substitute quizresultid
>(or
>the literal value) for qr.quizresultid. basically it's
going to find all
>the answers associated with that quizresultid, that were
correct (=1) and
>summing them up (count *).
>
>( select count(*) from quizresultanswer qra, quizanswer
qa
> where qra.quizanswerid = qa.quizanswerid
> and correct = 1
> and qra.quizresultid = qr.quizresultid ) as
AnsweredCorrect
>
>That help at all?
>--
>Jeff Schoolcraft
>http://thequeue.net/blog/
a>
>http://blogginga
bout.net/blogs/jeff/
>
>Quid quid latine dictum sit, altum videtur
>
>
>[Non-text portions of this message have been removed]
>
____________________________________________________________
_____
Advertisement: Getting married? Tell us why to WIN LetsShop
http://a.ninemsn.com.au/b.aspx?URL=http%3A%
2F%2Fwww%2Eletsshop%2Ecom%2FCompetitions%2FLetsMarry%2Ftabid
%2F549%2FDefault%2Easpx&_t=751480117&_r=HM_tagline_l
etsshop_wedding&_m=EXT
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:AspNetAnyQuestionIsOk-digest@yahoogroups.com
mailto:AspNetAnyQuestionIsOk-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|