How do I write a conditional statement (IF) with MySQL?
What you want is a CASE expression which is standard-SQL method of implementing a conditional and supported by every major database,

SELECT CASE WHEN 1 = 1 THEN 1 ELSE 12 END;


Or you can use the totally silly and proprietary IF statement

SELECT IF( 1=1, 1, 12 );