I’m trying to pull columns with a query where ‘grad_year’ is one of four years (4 OR statements), but I want entries of a specified year to appear first. This is the SQL I have. In this example, I want entries from 2011, 2012, 2013, and 2014. How do I get the 2012 entries, for example, to show up first? The rest of the order wouldn’t matter. Thank you!
SELECT user_meta.grad_year,
school_data.school
FROM user_meta
LEFT JOIN school_data
ON user_meta.school_id = school_data.id
WHERE school_id = 2
AND user_id != 102
AND (user_meta.grad_year = 2011
OR user_meta.grad_year = 2012
OR user_meta.grad_year = 2013
OR user_meta.grad_year = 2014)
LIMIT 0, 15
this might help