Skip to main content

List the emps in the asc order of Designations of those joined after the second half of 1981.

Answer:

select * from emp where hiredate > (’30-jun-81’) and to_char(hiredate,’YYYY’) = 1981 order by job asc;

select * from emp where hiredate > (’30-jun-81’) and to_char(hiredate,’YYYY’) = 1981 order by job asc;

Comments

  1. select * from emp where hiredate > ('30-JUN-1981') order by job asc;

    ReplyDelete
  2. select * from emp where hiredate >= '07-01-1981' order by job asc

    ReplyDelete

Post a Comment

Popular Posts

How to find out Max Salary from each department

You can find maximum salary for each department by grouping all records by DeptId and then using MAX() function to calculate maximum salary in each group or each department. SQL Query: SELECT DeptID, MAX(Salary) FROM Employee  GROUP BY DeptID. This questions become more interesting if Interviewer will ask you to print department name instead of department id, in that case you need to join Employee table with Department using foreign key DeptID, make sure you do LEFT or RIGHT OUTER JOIN to include departments without any employee as well.  Here is the query