Answers for "MySQL IF without else"

SQL
7

mysql else if

IF condition1 THEN
    statements;
ELSEIF condition2 THEN # OPTIONAL
	statements;
ELSE # OPTIONAL
    statements;
END IF;
Posted by: Guest on October-16-2020
0

MySQL IF without else

SELECT * FROM callback LEFT JOIN agent ON callback.agent_ID=agent.agent_ID 
	LEFT JOIN contact ON callback.contact_ID=contact.contact_ID WHERE callback.agent_ID =118
	AND DATE(callback.cb_dt) =curdate() 
    and Hour(time(callback.cb_dt)) <= Hour(time(UTC_TIMESTAMP()))
    and 
	(if(Hour(time(callback.cb_dt)) = Hour(time(UTC_TIMESTAMP())),
     minute(time(callback.cb_dt)) < minute(time(UTC_TIMESTAMP())) and
    cb_IsDeleted=0 ,cb_IsDeleted=0))
	and callback.isCalled=0;
Posted by: Guest on October-04-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language