DELIMITER //
CREATE PROCEDURE pTest()
BEGIN
DECLARE vHour INT;
SET vHour =10;
IF vHour>40 THEN
SELECT ‘加班了’;
END IF;
END//
DELIMITER ;
DELIMITER //
CREATE PROCEDURE pTest()
BEGIN
DECLARE vHour INT;
SET vHour =10;
IF vHour>40 THEN
SELECT ‘加班了’;
ELSE
SELECT ‘没加班’;
END IF;
END//
DELIMITER ;
DELIMITER $$
CREATE PROCEDURE pTest()
BEGIN
DECLARE vHour INT;
SET vHour =60;
IF vHour>70 THEN
SELECT ‘加班超多’;
ELSEIF vHour> 50 AND vHour<=70
THEN
SELECT ‘加班多’;
ELSEIF vHour >40 AND vHour<=50
THEN
SELECT ‘有加班’;
ELSE
SELECT ‘没加班’;
END IF;
END$
DELIMITER ;
原创文章,作者:端木书台,如若转载,请注明出处:https://blog.ytso.com/244911.html