if condition in a select query mysql code example
Example 1: select with condition query in mysql
SELECT * FROM `table_name`;
SELECT `col1`,`col2` FROM `table_name`;
SELECT `col1 as name`,`col2 as email` FROM `table_name`;
SELECT * FROM `table_name` WHERE id = '1';
Example 2: mysql use if on select
IF(expression ,expr_true, expr_false);