- #1
chrisalviola
- 80
- 0
This is my SQL in PHP
SELECT * FROM ExamQuestions where exam_id not in(Select ans_exam_id from StudAns where ans_user_id=".$_COOKIE['cuserid']." and ans_exam_id in(SELECT exam_id FROM ExamQuestions)) ORDER BY RAND()
when multiple users send this query to server it slows down. is there any way i can simplify this? do i need to use join or create view to increase fetching speed?
SELECT * FROM ExamQuestions where exam_id not in(Select ans_exam_id from StudAns where ans_user_id=".$_COOKIE['cuserid']." and ans_exam_id in(SELECT exam_id FROM ExamQuestions)) ORDER BY RAND()
when multiple users send this query to server it slows down. is there any way i can simplify this? do i need to use join or create view to increase fetching speed?