T-SQL: How to Select Rows By Certain Sum of a Column? - TechRepublic
Question
January 31, 2012 at 12:54 PM
stojanmk

T-SQL: How to Select Rows By Certain Sum of a Column?

by stojanmk . Updated 14 years, 5 months ago

Hi everyone. I have a table named as Questions with 3 columns(Id int, Question_Text varchar(200), Question_Points tinyint).
I need to select random selection with a condition the sum of Question_Points to be certain number(ex: sum(Question_Points) = 150). This should be actually generating test by total test points.

This discussion is locked

All Comments