[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

MySQL If then in query

I am trying to use

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

But getting an error.
0
Dallas Smetter
Asked:
Dallas Smetter
2 Solutions
 
Bhavesh ShahLead AnalysistCommented:
use case
case when SummerSchoolCampus='501' then 'your text' else 'else text' end
0
 
Manuel Marienne-DuchêneITMCommented:
CASE WHEN SummerSchoolCampus='501' THEN 'ALFREDO HIGH SCHOOL' END
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now