Link to home
Start Free TrialLog in
Avatar of smetterd
smetterdFlag for United States of America

asked on

Multiple conditions and values in MySQL query

The following query works fine

SELECT
SR_STU_ENROLL.NAME_L,
SR_STU_ENROLL.NAME_F,
SR_STU_ENROLL.CAMPUS_ID,
IF( SR_STU_ENROLL.GRD_LVL='12', '2013', '' ) AS gradYear,
SR_STU_ENROLL.STU_ID
FROM
SR_STU_ENROLL

How can I modify the if statement so that the grades and gradYears are all covered such as

if grd_lvl = 12 then output 2013
elseif grd_lvel =11 then output 2014

etc down to Kindergarten

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of ralmada
ralmada
Flag of Canada image

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
Avatar of smetterd

ASKER

Thank you!