please help in the following query
Display Employee Name, Dept Name, Salary, Grade, Experience (EX: XX Years YY Months ZZ Days) for all the employees
ENAME DNAME SAL GRADE EXPERIENCE
SCOTT RESEARCH 3000 4 12 Years 3 months 15 days
like this i need to get the output.
i have tried to write upto years but months,days i am not able to get.
select distinct ename,dname,sal,grade,
(round((months_between(sysdate,hiredate)/12))||' years' EXP
from emp,salgrade,dept
where dept.deptno=emp.deptno and sal between losal and highsal;
Here’s a T-SQL (SQL Server) solution which I’ve got working (based on tests so far). Sadly I don’t have an oracle instance to play on, but hopefully this shouldn’t be too hard to convert: