Useful shortcuts for vi editor

Showing posts with label intersect. Show all posts
Showing posts with label intersect. Show all posts

Wednesday 12 November 2014

How to use Intersect function?

For instance, you want to see same jobs for employees that belong to different manager in employees table.

Please run the sql lines in SQL Editor as "hr" user;

SELECT job_id FROM employees
WHERE manager_id = 121
INTERSECT
SELECT job_id FROM employees
WHERE manager_id  = 122;

Used Database User: HR