Link to home
Start Free TrialLog in
Avatar of buck2769
buck2769

asked on

help with loops

I have two tables, let's call them weighted_questions and users. I must select all of the accounts that have a score higher than a certain number. The score is calculated based on the questions, whether true or false, and the weight of that question. In other words I'm trying to select all users then based on that user's profile information in the users table I want to loop through the questions which will have a sql expression that will evaluate to true or false tied to it, if the expression evals to true then I add the weighted value to the question total for that user. If the question total is equal to or greater than the allowable amount, then I want this user to be selected.
This is the first time I've had to wrap me head around SQL this complex and I need a push in the right direction. Any help would be appreciated.
Avatar of Daniel Reynolds
Daniel Reynolds
Flag of United States of America image

Can you provide some table structure that might help us give you a clearer answer?
hi

>I want to loop through the questions which will have a sql expression that will evaluate to true or false tied to it

what is the expression to evaluate if true or false?
ASKER CERTIFIED SOLUTION
Avatar of buck2769
buck2769

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial