Solved

MySQL If then in query

Posted on 2013-05-21
2
282 Views
Last Modified: 2013-05-21
I am trying to use

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

But getting an error.
0
Comment
Question by:Dallas Smetter
2 Comments
 
LVL 19

Accepted Solution

by:
Bhavesh Shah earned 250 total points
Comment Utility
use case
case when SummerSchoolCampus='501' then 'your text' else 'else text' end
0
 
LVL 6

Assisted Solution

by:Manuel Marienne-Duchêne
Manuel Marienne-Duchêne earned 250 total points
Comment Utility
CASE WHEN SummerSchoolCampus='501' THEN 'ALFREDO HIGH SCHOOL' END
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now