Auto commit

This commit is contained in:
smallkun 2025-03-05 09:11:17 +08:00
parent 29925804ff
commit 43a25c48b0

View File

@ -366,6 +366,22 @@ BEGIN
END IF;
END $$
DELIMITER ;
#10
DELIMITER $$
DROP PROCEDURE IF EXISTS pro_GetTopStudent;
CREATE PROCEDURE pro_GetTopStudent(IN in_cid CHAR(11), OUT out_stuname VARCHAR(50))
BEGIN
SELECT st.stuname INTO out_stuname
FROM tb_students st, tb_scores sc
WHERE st.stuid = sc.student_id AND sc.course_id = in_cid
ORDER BY sc.score DESC
LIMIT 1;
END $$
DELIMITER ;
CALL pro_GetTopStudent(1, @result);
SELECT @result;
```