if else in mysql
snippet in sql

mysql select else if

user2800

select id, 
    (
    CASE 
        WHEN qty_1 <= '23' THEN price
        WHEN '23' > qty_1 && qty_2 <= '23' THEN price_2
        WHEN '23' > qty_2 && qty_3 <= '23' THEN price_3
        WHEN '23' > qty_3 THEN price_4
        ELSE 1
    END) AS total
 from product;

mysql else if

user9416

IF condition1 THEN
    statements;
ELSEIF condition2 THEN # OPTIONAL
	statements;
ELSE # OPTIONAL
    statements;
END IF;

mysql if example

user939

SELECT SUM(IF(user.name LIKE '%bob%',1,0)) AS `total_bobs`,

mysql if else

user3958

IF condition THEN
   statements;
ELSE
   else-statements;
END IF;

if else in mysql

user213


  SELECT IF(STRCMP("hello","bye") = 0, "YES", "NO");