I am trying to write an Oracle query for a homework assignment. The assignment is to write one query to return the employee_id, job_id, hire_date and department_id of all employees and a second query listing employee_id, job_id, start_date and department_id from the job_hist table and combine the results as one single output. Make sure you suppress duplicates in the output.
Code I Have:
SELECT employee_id AS "Employee ID", job_id AS "Job Id", TO_CHAR(NULL) hire_date "Hire Date", department_id AS "Department Id",
FROM employees
UNION
SELECT employee_id AS "Employee Id", job_id AS "Job Id", TO_CHAR(NULL) start_date "Start Date",department_id AS "Department Id",
FROM job_history;
Error I am getting:
ORA-00923: FROM keyword not found where expected
From what I can tell in the book, the sequence looks right. Any help would be great!
Code after removing the commas:
SELECT employee_id AS "Employee ID", job_id AS "Job Id", TO_CHAR(NULL) hire_date "Hire Date", department_id AS "Department Id"
FROM employees
UNION
SELECT employee_id AS "Employee Id", job_id AS "Job Id", TO_CHAR(NULL) start_date "Start Date",department_id AS "Department Id"
FROM job_history;
Is this working?