mysql select field if condition
snippet in sql

mysql select field if condition

user2958

select IF('fieldname with condition','if true value','if false value') from table_name where 1;