current_manager
Documentation | Employees (MySQL database) |
Name | current_manager |
Returns the manager of a department choosing the most recent one from the manager list.
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | OUT | Returns | varchar(32) | Returns the manager of a department choosing the most recent one from the manager list. |
Returns the manager of a department choosing the most recent one from the manager list. | ||||
2 | IN | dept_id | char(4) | Department identification number. |
Department identification number. |
Script
begin declare max_date date; set max_date = ( select max(from_date) from dept_manager where dept_no = dept_id ); set @max_date=max_date; return ( select emp_name(emp_no) from dept_manager where dept_no = dept_id and from_date = max_date limit 1 ); end |
Exported: 2018-11-09 14:32, Last imported: 2018-08-06 09:21