Auto commit
This commit is contained in:
parent
43b718db0c
commit
077f0330f5
@ -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);
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user