Hi All
I want to figure out all the managers who don't have any employee working under them.
There are many ways to do so but I want to achieve it with Model and MATCH_RECOGNIZE, please help in building it.
SELECT
e.employee_id,
e.first_name
FROM
employees e
WHERE
NOT EXISTS (
SELECT employee_id
FROM
employees s
WHERE s.manager_id = e.employee_id);
SELECT *
FROM employees
MODEL
DIMENSION BY (employee_id)
MEASURES (manager_id, first_name)
RULES
(
);