Change value from 1 To Yes In MySQL select statement

case, mysql, sql

Solution

Simple and easy way to achieve this is:

SELECT IF(inty = 1, 'YES', 'No') AS internetApproved FROM Table1

Problem

I'm only able to SELECT on a table. The table has a column called inty with a value of 0 or 1 I am currently selecting inty as: ``` SELECT inty AS InternetApproved FROM Table1 ``` Is there a way to reformat the data within the SQL SELECT so that if the value is 0 make it No and if the value is 1 make it Yes for display purposes in the output SELECT results?

Original source