February 19, 2009 at 8:56 am
Hi all,
I have tables Chapters, questions and answers for online exams.
Chapter table contain 10 chapters. Each chapter contains 30 to 40 questions in questions table.
My logic would be,when i pass chapter id it should generate the random questions with no duplicates questions in that queston set and that should be different questions set for different users.
Could any one help me on this?
Thanks in advance,
February 19, 2009 at 9:33 am
Try using the TOP(N) predicate with some random order.
Something like:
SELECT top (10) questions
from questions_table
where question_set=5
order by newID()
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
February 19, 2009 at 11:19 pm
Thank you sooo much for simple and awesome query.....
Any more alternates?
Thanks,
March 4, 2009 at 12:13 am
Bagath (2/19/2009)
Thank you sooo much for simple and awesome query.....Any more alternates?
Thanks,
Heh... WHY? Isn't that one good enough? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply