Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql if else

SELECT OrderID, Quantity, 
CASE WHEN Quantity > 10 THEN "MORE" ELSE "LESS" END as x
FROM OrderDetails;

SELECT OrderID, Quantity, 
IF (Quantity > 10, "MORE", "LESS") as x
FROM OrderDetails;
 
PREVIOUS NEXT
Tagged: #mysql
ADD COMMENT
Topic
Name
9+2 =