Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
MaxNumberofQuestions	QuestionNo	QuestionMarks	ChildQuestionNo	ChildQuestionMqrks	sub	ObtMarks	ChildObtMarks
4	2	20	1	5	001	NULL	3
4	2	20	2	5	001	NULL	3
4	2	20	3	5	001	NULL	5
4	2	20	4	5	001	NULL	1
4	2	20	5	5	001	NULL	1
4	2	20	6	5	001	NULL	3
2	4	10	1	5	001	NULL	5
2	4	10	2	5	001	NULL	1
2	4	10	3	5	001	NULL	1


Required data rows as per maxnumberofquestions

MaxNumberofQuestions	QuestionNo	QuestionMarks	ChildQuestionNo	ChildQuestionMqrks	sub	ObtMarks	ChildObtMarks
4	2	20	1	5	001	NULL	3
4	2	20	2	5	001	NULL	3
4	2	20	3	5	001	NULL	5
4	2	20	4	5	001	NULL	1
2	4	10	1	5	001	NULL	5
2	4	10	2	5	001	NULL	1


What I have tried:

plz help me to get the required result by using sql query thanks
Posted
Updated 2-Feb-18 9:20am

1 solution

SQL
SELECT * FROM Questions WHERE [ChildQuestionNo] <= [MaxNumberofQuestions]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900