w3resource

Oracle: List the name, hire date of all the employees who joined on 1-JUL-2006, 24-MAR-2007, 04-JAN-2008 in ascending order of seniority

Oracle Operator: Exercise-12 with Solution

Write query to list the name (first and last name), hire date of all the employees who joined on 1-JUL-2006, 24-MAR-2007, 04-JAN-2008 in ascending order of seniority.

Sample table : employees


Sample Solution:

Oracle Code:

SELECT first_name, last_name, hire_date 
FROM employees 
WHERE hire_date IN('01-JUL-2006','24-MAR-2007','04-JAN-2008') 
ORDER  BY hire_date asc;

Output:


FIRST_NAME           LAST_NAME                 HIRE_DATE
-------------------- ------------------------- ---------
Samuel               McCain                    01-JUL-06
Elizabeth            Bates                     24-MAR-07
Charles              Johnson                   04-JAN-08

Pictorial Presentation:

List the name, hire date of all the employees  who joined on specified dates in ascending order of seniority

Improve this sample solution and post your code through Disqus.

Previous: Write a query to list the name (first and last name), hire date of all the employees who joined before or after 2005.
Next: Write a query to concatenate first name, last name and job id from employees table in the following format.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.