mysql use if on select
snippet in sql

if inside select mysql

user3074

SELECT IF(1>3,'true','false');

mysql use if on select

user1488

IF(expression ,expr_true, expr_false);