Auto commit

This commit is contained in:
smallkun 2025-03-20 16:46:44 +08:00
parent 43b718db0c
commit 077f0330f5

View File

@ -339,6 +339,16 @@ CALL get_department_employee_count(1);
创建一个存储过程 `get_job_employee_count`接受职位ID作为参数返回该职位的员工总数。
```sql
DELIMITER $$
DROP PROCEDURE IF EXISTS get_job_employee_count;
CREATE PROCEDURE get_job_employee_count(IN id INT)
BEGIN
SELECT COUNT(*)
FROM employee e
WHERE e.job_id = id;
END $$
DELIMITER ;
CALL get_job_employee_count(1);
```