MySQL: Using if statements for data conversion in a SELECT

I have an integer field in my database that I'd like to display as Yes/No in a report. You can do this conversion in your front end code, or you can use a MySQL if statement to do the conversion for you.

SELECT IF(CustPrimary = 1,'Yes','No') AS CustPrimary FROM Customer;


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.12.34.209
To prevent spam please submit by clicking the kitten: