I have been studying about MySQL functions. while studying about the functions i saw the function named "MySQL Stored Function".
Here is Example that i don't understand this two thing. One is
SELECT
customerName, CustomerLevel(creditLimit)
FROM
customers
ORDER BY customerName;
Second one is
DELIMITER $$
CREATE FUNCTION CustomerLevel(p_creditLimit double) RETURNS VARCHAR(10)
DETERMINISTIC
BEGIN
DECLARE lvl varchar(10);
IF p_creditLimit > 50000 THEN
SET lvl = 'PLATINUM';
ELSEIF (p_creditLimit <= 50000 AND p_creditLimit >= 10000) THEN
SET lvl = 'GOLD';
ELSEIF p_creditLimit < 10000 THEN
SET lvl = 'SILVER';
END IF;
RETURN (lvl);
END
So Can You just little describe about this.
but i need little help according to this example. Thanks.