SELECT NULLIF(1,1);
SELECT NULLIF(1,2);
SELECT NULLIF('MySQL NULLIF','MySQL NULLIF');
SELECT NULLIF('MySQL NULLIF','MySQL IFNULL');
SELECT NULLIF(1,NULL);
SELECT NULLIF(NULL,1);
SELECT 1/0; -- cause error
SELECT 1/NULLIF(0,0); -- return NULL
SELECT orderNumber, orderdate, requiredDate, shippedDate, status FROM orders WHERE orderDate BETWEEN '2003-06-01' AND '2003-06-30';
SELECT SUM(IF(status = 'Shipped',1,0)) / SUM(IF(status = 'Cancelled',1,0)) FROM orders WHERE orderDate BETWEEN '2003-06-01' and '2003-06-30';
SELECT SUM(IF(status = 'Shipped', 1, 0)) / NULLIF(SUM(IF(status = 'Cancelled', 1, 0)), 0) FROM orders WHERE orderDate BETWEEN '2003-06-01' AND '2003-06-30';