Beruflich Dokumente
Kultur Dokumente
--here the EMPLOYEE_ID 200 will not appear because we add another column in query
DEPARTMENT_ID, so it will compare 3 columns
SELECT EMPLOYEE_ID emp_id , JOB_ID job ,DEPARTMENT_ID
FROM
EMPLOYEES
INTERSECT
SELECT EMPLOYEE_ID emno, JOB_ID jobid,DEPARTMENT_ID
FROM
JOB_HISTORY;
--i want you to display the "first_name last_name " also in this query as full name
-----------------------------------------------
--the order by can see only column name in the first querey
SELECT EMPLOYEE_ID emp_id, JOB_ID, salary
FROM
EMPLOYEES
UNION
SELECT EMPLOYEE_ID empno , JOB_ID, 0 salary
FROM
JOB_HISTORY
ORDER BY emp_id; -- try to use empno, it will give error
--you can use the column number to solve the issue of def. column name
SELECT EMPLOYEE_ID emp_id, JOB_ID, salary
FROM
EMPLOYEES
UNION
SELECT EMPLOYEE_ID empno , JOB_ID, 0 salary
FROM
JOB_HISTORY
ORDER BY 1;