Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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;
 
PREVIOUS NEXT
Tagged: #MySQL #IF
ADD COMMENT
Topic
Name
1+9 =