Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:45:44+00:00 2026-06-01T04:45:44+00:00

I am trying to write an Oracle query for a homework assignment. The assignment

  • 0

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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:45:45+00:00Added an answer on June 1, 2026 at 4:45 am
    SELECT employee_id AS "Employee Id", job_id AS "Job Id", TO_CHAR(hire_date,'yyyy-mm-dd') AS "Some date", department_id AS "Department Id"
    FROM employees
    UNION
    SELECT employee_id AS "Employee Id", job_id AS "Job Id", TO_CHAR(start_date,'yyyy-mm-dd') AS "Some date",department_id AS "Department Id"
    FROM job_history;
    

    Is this working?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a HQL/Criteria/Native SQL query that will return all Employees that
i'm trying to write an Oracle query that sorts the results in the same
I'm using Oracle 11gR2 and I am trying to write a query that returns
I'm trying to write this query using Hibernate 3 and Oracle 10. from Alert
I am trying to write an SQL query. If it works in Oracle SQL
I'm trying to write a query in Oracle SQL to access a particular substring
I have an oracle database populated with million records. I am trying to write
I am trying to write a simple Oracle Stored Procedure: CREATE OR REPLACE PROCEDURE
I'm trying to write a command in Oracle that will wither ADD or MODIFY
I'm trying to write a plain SQL statement for building an Oracle report but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.