It looks like you're trying to set the value, and then a category based on the value. It would be a lot cleaner with a CASE statement like:
UPDATE chicago_public_schools
SET
Leaders_Score = inLeaderScore,
Leaders_Icon = CASE WHEN inLeaderScore > 80 THEN 'Very Strong'
WHEN inLeaderScore > 60 THEN 'Strong'
WHEN inLeaderScore > 40 THEN 'Average'
WHEN inLeaderScore > 20 THEN 'Weak'
WHEN inLeaderScore > 0 THEN 'Very Weak'
END
WHERE
School_ID = inSchoolID;
* Be the first to Make Comment