MySQL If then in query

I am trying to use

if (SummerSchoolCampus='501') then
 'Alfredo High School' as CampusDescription,

But getting an error.
Dallas SmetterSolution EngineerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Bhavesh ShahConnect With a Mentor Lead AnalysistCommented:
use case
case when SummerSchoolCampus='501' then 'your text' else 'else text' end
0
 
Manuel Marienne-DuchĂȘneConnect With a Mentor ITMCommented:
CASE WHEN SummerSchoolCampus='501' THEN 'ALFREDO HIGH SCHOOL' END
0
All Courses

From novice to tech pro — start learning today.