Last active
January 18, 2023 05:10
-
-
Save faizakram/f80962b6340469ba802e7c898c76c63d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t1.name user_name, dep.name department, t1.created_on | |
FROM employee t1 JOIN department dep ON t1.department_id =dep.id | |
WHERE t1.created_on = (SELECT MAX(t2.created_on) | |
FROM employee t2 | |
WHERE t2.department_id = t1.department_id); | |
-- If not exists in the child table | |
SELECT p.id | |
FROM project p | |
WHERE NOT EXISTS ( | |
SELECT 1 FROM project_description pd | |
WHERE pd.project_id= p.id AND pd.project_service_type_id =33 | |
) ORDER BY p.id; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Department
Employee Table