Created
April 8, 2014 08:03
-
-
Save sqlparser/10100781 to your computer and use it in GitHub Desktop.
align main keywords
This file contains hidden or 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
DELETE FROM job_history jh | |
WHERE employee_id = (SELECT employee_id | |
FROM employee e | |
WHERE jh.employee_id = e.employee_id | |
AND start_date = (SELECT Min(start_date) | |
FROM job_history jh | |
WHERE jh.employee_id = e.employee_id) | |
AND 5 > (SELECT Count( * ) | |
FROM job_history jh | |
WHERE jh.employee_id = e.employee_id | |
GROUP BY employee_id | |
HAVING Count( * ) >= 4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment