Here i want to select questions with two different difficulty from same table. I am using query :
readAllQuestions = [NSString stringWithFormat: @"SELECT * FROM tbl_questions WHERE difficulty IN(1,3) AND approved = 1"];
Its working. Now i want to limit the questions to 100 and it includes 50 questions with difficulty 1 and other 50 with difficulty 3. Using LIMIT only give first 100 questions.
How to do this without using two different queries?? Please help..
You can do so with subselects:
(assuming the primary key is called ‘id’)